From f1d9ac673ce644a7e2397bd1c4687083157f4a17 Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Sat, 13 Dec 2014 10:20:03 +0000 Subject: [PATCH] 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. --- pv/view/view.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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() -- 2.30.2