Commit f87b042
feat(nodes): Center pasted nodes at mouse location (#4595)
* Initial commit. Feature works, but code might need some cleanup
* Cleaned up diff
* Made mousePosition a XYPosition again so its nicely typed
* Fixed yarn issues
* Paste now properly takes node width/height into account when pasting
* feat(ui): use react's types in the `onMouseMove` `reactflow` handler
* feat(ui): use refs to access `reactflow`'s DOM elements
* feat(ui): use a ref to store cursor position in nodes
---------
Co-authored-by: psychedelicious <[email protected]>1 parent 183e2c3 commit f87b042
File tree
2 files changed
+44
-6
lines changed- invokeai/frontend/web/src/features/nodes
- components/flow
- store
2 files changed
+44
-6
lines changedLines changed: 18 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
82 | | - | |
| 83 | + | |
| 84 | + | |
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
| |||
154 | 156 | | |
155 | 157 | | |
156 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
157 | 170 | | |
158 | 171 | | |
159 | 172 | | |
| |||
166 | 179 | | |
167 | 180 | | |
168 | 181 | | |
169 | | - | |
| 182 | + | |
170 | 183 | | |
171 | 184 | | |
172 | 185 | | |
173 | 186 | | |
174 | 187 | | |
| 188 | + | |
175 | 189 | | |
176 | 190 | | |
177 | 191 | | |
178 | 192 | | |
179 | 193 | | |
180 | 194 | | |
| 195 | + | |
181 | 196 | | |
182 | 197 | | |
183 | 198 | | |
| |||
Lines changed: 26 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
715 | 716 | | |
716 | 717 | | |
717 | 718 | | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
718 | 737 | | |
719 | | - | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
720 | 743 | | |
721 | 744 | | |
722 | 745 | | |
| |||
745 | 768 | | |
746 | 769 | | |
747 | 770 | | |
748 | | - | |
749 | | - | |
| 771 | + | |
| 772 | + | |
750 | 773 | | |
751 | 774 | | |
752 | 775 | | |
| |||
0 commit comments