Commit 6e1fb68
committed
Fix GraphNode frag/vert port positions misaligned
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: godotengine#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.1 parent 215acd5 commit 6e1fb68
1 file changed
+29
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
980 | 980 | | |
981 | 981 | | |
982 | 982 | | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
983 | 987 | | |
984 | 988 | | |
985 | 989 | | |
986 | | - | |
| 990 | + | |
| 991 | + | |
987 | 992 | | |
988 | 993 | | |
989 | 994 | | |
990 | 995 | | |
991 | 996 | | |
992 | 997 | | |
993 | 998 | | |
994 | | - | |
995 | | - | |
996 | | - | |
997 | | - | |
998 | | - | |
999 | | - | |
1000 | | - | |
1001 | | - | |
1002 | | - | |
1003 | | - | |
1004 | | - | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
1005 | 1016 | | |
1006 | | - | |
1007 | | - | |
1008 | | - | |
1009 | | - | |
1010 | | - | |
1011 | | - | |
1012 | | - | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
1013 | 1020 | | |
1014 | 1021 | | |
1015 | | - | |
1016 | | - | |
| 1022 | + | |
| 1023 | + | |
1017 | 1024 | | |
1018 | | - | |
| 1025 | + | |
1019 | 1026 | | |
1020 | 1027 | | |
1021 | 1028 | | |
| |||
0 commit comments