Commit c81a2b2
Do not delay fit to view on graph restore (#7645)
Fixes a bug where swapping to a different workflow from the inside of a
subgraph would cause nodes to be in an incorrect position after swapping
back. in vue mode
Prior to an unknown-but-recent PR, all nodes would would stack on the
origin. This PR instead solves the remaining issue where having
`ComfyEnableWorkflowViewRestore` would cause incorrect node positions.
This is done by not delaying the fitView by a frame (which causes it to
occur after the graph is no longer in the configuring state). In order
to accomplish this, the code in LGraphNode has been updated to allow
measuring node bounds without requiring a ctx argument. This arg is only
used to ensure sufficient width for a node's title and is irrelevant
when loading an existing graph.
| Before | After |
| ------ | ----- |
| <img width="360" alt="before"
src="https://github.com/user-attachments/assets/7f73817b-36e9-4400-8342-9e660cb36628"/>
| <img width="360" alt="after"
src="https://github.com/user-attachments/assets/c7ab4b99-2797-4276-9703-58d489cc3eaf"
/>|
See also #7591, which solves similar issues, but does not resolve this
bug.
┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-7645-Do-not-delay-fit-to-view-on-graph-restore-2ce6d73d36508153972cc7b5948ce375)
by [Unito](https://www.unito.io)1 parent d2281f6 commit c81a2b2
File tree
3 files changed
+17
-14
lines changed- src
- lib/litegraph/src
- scripts
- services
3 files changed
+17
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2000 | 2000 | | |
2001 | 2001 | | |
2002 | 2002 | | |
2003 | | - | |
| 2003 | + | |
2004 | 2004 | | |
2005 | 2005 | | |
2006 | 2006 | | |
| |||
2013 | 2013 | | |
2014 | 2014 | | |
2015 | 2015 | | |
2016 | | - | |
| 2016 | + | |
2017 | 2017 | | |
2018 | 2018 | | |
2019 | | - | |
2020 | | - | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
2021 | 2023 | | |
2022 | 2024 | | |
2023 | 2025 | | |
| |||
2047 | 2049 | | |
2048 | 2050 | | |
2049 | 2051 | | |
2050 | | - | |
| 2052 | + | |
2051 | 2053 | | |
2052 | 2054 | | |
2053 | 2055 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1224 | 1224 | | |
1225 | 1225 | | |
1226 | 1226 | | |
1227 | | - | |
1228 | | - | |
1229 | | - | |
1230 | | - | |
1231 | | - | |
1232 | | - | |
| 1227 | + | |
1233 | 1228 | | |
1234 | 1229 | | |
1235 | 1230 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
868 | 868 | | |
869 | 869 | | |
870 | 870 | | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
871 | 878 | | |
872 | 879 | | |
873 | 880 | | |
| |||
881 | 888 | | |
882 | 889 | | |
883 | 890 | | |
884 | | - | |
885 | | - | |
886 | | - | |
| 891 | + | |
887 | 892 | | |
888 | 893 | | |
| 894 | + | |
889 | 895 | | |
890 | 896 | | |
891 | 897 | | |
| |||
0 commit comments