From 82ba380c459cc3d0d13e2326aa4a9780614a8fde Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Sat, 13 Dec 2014 10:19:16 +0000 Subject: [PATCH] RowItem: Fixed v_extents initial conditions Using (0, 0) as initializers for the global extent calculation is suboptimal as it causes the lowest y coordinate to always be 0 when all traces have positive y offsets. When moving all traces down, the scroll area becomes too large as a result. Using (INT_MAX, INT_MIN) instead fixes this. --- pv/view/rowitemowner.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pv/view/rowitemowner.cpp b/pv/view/rowitemowner.cpp index 625620e..8970f45 100644 --- a/pv/view/rowitemowner.cpp +++ b/pv/view/rowitemowner.cpp @@ -94,7 +94,8 @@ RowItemOwner::const_iterator RowItemOwner::end() const pair RowItemOwner::v_extents() const { - pair extents(0, 0); + pair extents(INT_MAX, INT_MIN); + for (const shared_ptr r : child_items()) { assert(r); if (!r->enabled()) -- 2.30.2