View: Fix #515 by fixing typo and extent handling
authorSoeren Apel <soeren@apelpie.net>
Sat, 13 Dec 2014 10:20:03 +0000 (10:20 +0000)
committerJoel Holdsworth <joel@airwebreathe.org.uk>
Sat, 13 Dec 2014 10:20:03 +0000 (10:20 +0000)
Typo: extents.first instead of extents.second

The extra scoll height was too large and could result in all
traces being removed from view. To avoid this, the user now has
half of the view height as extra scroll height.

pv/view/view.cpp

index 539581ad1ce95bd934c5f030639455c235ce7e8d..f349861f226fe0f1833974b0d9ca9216e6a1466c 100644 (file)
@@ -486,9 +486,8 @@ void View::update_scroll()
        verticalScrollBar()->setSingleStep(areaSize.height() / 8);
 
        const pair<int, int> extents = v_extents();
-       const int extra_scroll_height = (extents.second - extents.first) / 4;
-       verticalScrollBar()->setRange(extents.first - extra_scroll_height,
-               extents.first + extra_scroll_height);
+       verticalScrollBar()->setRange(extents.first - (areaSize.height() / 2),
+               extents.second - (areaSize.height() / 2));
 }
 
 void View::update_layout()