🐛 Fix weird positioning of component mixing undos and cut/paste

This commit is contained in:
Pablo Alba 2024-01-26 18:31:40 +01:00 committed by Andrey Antukh
parent 4c815998f8
commit 8bd10c3c04
4 changed files with 26 additions and 24 deletions

View file

@ -254,6 +254,7 @@
([changes library-data component-id it page delta old-id parent-id frame-id]
(let [component (ctkl/get-deleted-component library-data component-id)
parent (get-in page [:objects parent-id])
main-inst (get-in component [:objects (:main-instance-id component)])
inside-component? (some? (ctn/get-instance-root (:objects page) parent))
shapes (cfh/get-children-with-self (:objects component) (:main-instance-id component))
@ -281,7 +282,7 @@
changes (reduce #(pcb/add-object %1 %2 {:ignore-touched true})
changes
(rest shapes))]
{:changes (pcb/restore-component changes component-id (:id page))
{:changes (pcb/restore-component changes component-id (:id page) main-inst)
:shape (first shapes)})))
;; ---- General library synchronization functions ----