offset += extents.second;
}
- // Assign proper vertical offsets to each channel in the group
- new_trace_group->restack_items();
-
- // If this is a new group, enqueue it in the new top level
- // items list
- if (!new_traces_in_group.empty() && new_trace_group)
- new_top_level_items.push_back(new_trace_group);
+ if (new_trace_group) {
+ // Assign proper vertical offsets to each channel in the group
+ new_trace_group->restack_items();
+
+ // If this is a new group, enqueue it in the new top level
+ // items list
+ if (!new_traces_in_group.empty())
+ new_top_level_items.push_back(new_trace_group);
+ }
}
// Enqueue the remaining logic channels in a group
// 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();