]> sigrok.org Git - pulseview.git/commitdiff
View: Restore the original signals_changed() positioning code
authorSoeren Apel <redacted>
Thu, 7 Apr 2016 20:01:31 +0000 (22:01 +0200)
committerSoeren Apel <redacted>
Thu, 7 Apr 2016 20:01:31 +0000 (22:01 +0200)
pv/view/view.cpp

index 758e7118d8e94f2cee90f8334774056b8decc2b2..5649bdc849e5609dea698a21bce41b8d60102e2e 100644 (file)
@@ -1090,15 +1090,19 @@ void View::signals_changed()
 
        // Add and position the pending top levels items
        for (auto item : new_top_level_items) {
+               add_child_item(item);
+
                // Position the item after the last item or at the top if there is none
                int offset = v_extents().second;
+               const pair<int, int> extents = item->v_extents();
+
+               if (item->enabled())
+                       offset += -extents.first;
 
-               add_child_item(item);
                item->force_to_v_offset(offset);
 
-               const pair<int, int> extents = item->v_extents();
                if (item->enabled())
-                       offset += (extents.second - extents.first);
+                       offset += extents.second;
        }
 
        update_layout();