0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-23 06:58:58 -05:00

🐛 Fix move anidated structures withc component copies to other component copies

This commit is contained in:
Alejandro Alonso 2024-03-15 13:33:32 +01:00 committed by Andrés Moya
parent 892acecd9b
commit 4606785e5f

View file

@ -905,6 +905,11 @@
moving-shapes-ids
(map :id moving-shapes)
moving-shapes-children-ids
(->> moving-shapes
(mapcat #(cfh/get-children-with-self objects (:id %)))
(map :id))
changes
(-> (pcb/empty-changes it page-id)
(pcb/with-objects objects)
@ -913,7 +918,7 @@
(pcb/update-shapes moving-shapes-ids ctl/remove-layout-item-data))
;; Remove component-root property when moving a shape inside a component
(cond-> (ctn/get-instance-root objects frame)
(pcb/update-shapes moving-shapes-ids #(dissoc % :component-root)))
(pcb/update-shapes moving-shapes-children-ids #(dissoc % :component-root)))
;; Add component-root property when moving a component outside a component
(cond-> (not (ctn/get-instance-root objects frame))
(pcb/update-shapes moving-shapes-ids (fn [shape]