You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue conclusion: GraphNode port connections appear misaligned when switching between vertex and fragment modes, only realigning after zoom or layout refresh.
Investigation: The root cause was due to port positions being calculated before child layouts had finalized, resulting in inaccurate Y positions for ports. The original implementation relied on Control::position.y, which was not yet updated during the initial layout pass.
Explaination: This fix computes vertical offset using titlebar and stylebox sizes instead, ensuring port alignment is correct immediately after layout, without relying on zoom-triggered re-layouts.
Resolves: #105232
Add layout mode check to distinguish GraphEditor and ShaderGraphEditor
Fix port position calculation by distinguishing between GraphEditor and ShaderGraphEditor layouts.
Due to differences in layout flow and update timing (CPU vs GPU), ShaderGraphEditor requires manual vertical offset calculation, while standard GraphEditor can directly get the actual child positions after layout in run time.
This change adds a layout mode check (`is_using_resort_layout) to determine the appropriate method for computing port positions.
Fixed nits using cached values and removed redundant condition variable definition.
Add comment for the condition checking.
// This helps to immediately achieve the initial y "original point" of the slots, which the sum of the titlebar height and the top margin of the panel.
986
+
int vertical_ofs = titlebar_hbox->get_size().height + theme_cache.titlebar->get_minimum_size().height + theme_cache.panel->get_margin(SIDE_TOP);
983
987
984
988
left_port_cache.clear();
985
989
right_port_cache.clear();
986
-
int slot_index = 0;
990
+
991
+
slot_count = 0; // Reset the slot count, which is the index of the current slot.
987
992
988
993
for (int i = 0; i < get_child_count(false); i++) {
989
994
Control *child = as_sortable_control(get_child(i, false), SortableVisibilityMode::IGNORE);
0 commit comments