From: Soeren Apel Date: Sat, 13 Dec 2014 10:19:16 +0000 (+0000) Subject: RowItem: Fixed v_extents initial conditions X-Git-Tag: pulseview-0.3.0~361 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=82ba380c459cc3d0d13e2326aa4a9780614a8fde;p=pulseview.git 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. --- diff --git a/pv/view/rowitemowner.cpp b/pv/view/rowitemowner.cpp index 625620ed..8970f45a 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())