[haiku-commits] r34551 - haiku/trunk/src/apps/debuganalyzer/gui/main_window

  • From: ingo_weinhold@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 8 Dec 2009 14:53:58 +0100 (CET)

Author: bonefish
Date: 2009-12-08 14:53:58 +0100 (Tue, 08 Dec 2009)
New Revision: 34551
Changeset: http://dev.haiku-os.org/changeset/34551/haiku

Modified:
   haiku/trunk/src/apps/debuganalyzer/gui/main_window/SchedulingPage.cpp
Log:
Allow to zoom out up to 1000000 ns per pixel instead of 1000. Missed that when
switching from micro- to nanoseconds.


Modified: haiku/trunk/src/apps/debuganalyzer/gui/main_window/SchedulingPage.cpp
===================================================================
--- haiku/trunk/src/apps/debuganalyzer/gui/main_window/SchedulingPage.cpp       
2009-12-08 13:39:39 UTC (rev 34550)
+++ haiku/trunk/src/apps/debuganalyzer/gui/main_window/SchedulingPage.cpp       
2009-12-08 13:53:58 UTC (rev 34551)
@@ -324,7 +324,7 @@
                BaseView("scheduling", fontInfo),
                fStartTime(0),
                fEndTime(0),
-               fUSecsPerPixel(1000),
+               fNSecsPerPixel(1000000),
                fLastMousePos(-1, -1),
                fListener(NULL)
        {
@@ -375,7 +375,7 @@
        virtual BSize MinSize()
        {
                nanotime_t timeSpan = fModel != NULL ? fModel->LastEventTime() 
: 0;
-               float width = std::max(float(timeSpan / fUSecsPerPixel), 
100.0f);
+               float width = std::max(float(timeSpan / fNSecsPerPixel), 
100.0f);
                return BSize(width, TotalHeight());
        }
 
@@ -470,8 +470,8 @@
 
                                SetHighColor(color);
                                BRect rect = LineRect(i);
-                               rect.left = startTime / fUSecsPerPixel;
-                               rect.right = endTime / fUSecsPerPixel - 1;
+                               rect.left = startTime / fNSecsPerPixel;
+                               rect.right = endTime / fNSecsPerPixel - 1;
                                FillRect(rect);
                        }
                }
@@ -597,9 +597,9 @@
        {
                if (fModel != NULL) {
                        float scrollOffset = _ScrollOffset();
-                       _startTime = (nanotime_t)scrollOffset * fUSecsPerPixel;
+                       _startTime = (nanotime_t)scrollOffset * fNSecsPerPixel;
                        _endTime = (nanotime_t)(scrollOffset + Bounds().Width() 
+ 1)
-                               * fUSecsPerPixel;
+                               * fNSecsPerPixel;
                } else {
                        _startTime = 0;
                        _endTime = 1;
@@ -620,7 +620,7 @@
 
                // compute the domain point where to zoom in
                float scrollOffset = _ScrollOffset();
-               double timeForX = (scrollOffset + x) * fUSecsPerPixel;
+               double timeForX = (scrollOffset + x) * fNSecsPerPixel;
 
                uint32 factor = 4;
                if (steps < 0) {
@@ -628,23 +628,23 @@
                        factor = 1;
                }
 
-               uint32 oldUsecPerPixel = fUSecsPerPixel;
+               uint32 oldNsecPerPixel = fNSecsPerPixel;
                for (; steps > 0; steps--)
-                       fUSecsPerPixel = fUSecsPerPixel * factor / 2;
+                       fNSecsPerPixel = fNSecsPerPixel * factor / 2;
 
-               if (fUSecsPerPixel < 1)
-                       fUSecsPerPixel = 1;
-               else if (fUSecsPerPixel > 1000)
-                       fUSecsPerPixel = 1000;
+               if (fNSecsPerPixel < 1)
+                       fNSecsPerPixel = 1;
+               else if (fNSecsPerPixel > 1000000)
+                       fNSecsPerPixel = 1000000;
 
-               if (fUSecsPerPixel == oldUsecPerPixel)
+               if (fNSecsPerPixel == oldNsecPerPixel)
                        return;
 
                Invalidate();
 
                UpdateScrollBar();
                if (BScrollBar* scrollBar = ScrollBar(B_HORIZONTAL))
-                       scrollBar->SetValue(timeForX / fUSecsPerPixel - x);
+                       scrollBar->SetValue(timeForX / fNSecsPerPixel - x);
 
                if (fListener != NULL) {
                        fListener->DataWidthChanged();
@@ -872,7 +872,7 @@
        SchedulingData                  fSchedulingData;
        nanotime_t                              fStartTime;
        nanotime_t                              fEndTime;
-       uint32                                  fUSecsPerPixel;
+       uint32                                  fNSecsPerPixel;
        BPoint                                  fLastMousePos;
        Listener*                               fListener;
 };


Other related posts:

  • » [haiku-commits] r34551 - haiku/trunk/src/apps/debuganalyzer/gui/main_window - ingo_weinhold