From: Soeren Apel Date: Sat, 13 Dec 2014 10:20:03 +0000 (+0000) Subject: View: Fix #515 by fixing typo and extent handling X-Git-Url: http://git.code-monkey.de/?a=commitdiff_plain;h=f1d9ac673ce644a7e2397bd1c4687083157f4a17;hp=82ba380c459cc3d0d13e2326aa4a9780614a8fde;p=pulseview.git View: Fix #515 by fixing typo and extent handling 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. --- diff --git a/pv/view/view.cpp b/pv/view/view.cpp index 539581a..f349861 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -486,9 +486,8 @@ void View::update_scroll() verticalScrollBar()->setSingleStep(areaSize.height() / 8); const pair 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()