🐛 Fix create a main component inside another and move one main inside another

This commit is contained in:
Pablo Alba 2023-11-22 13:14:57 +01:00 committed by Andrés Moya
parent cee827a97b
commit 23527b1d19
4 changed files with 22 additions and 17 deletions

View file

@ -840,6 +840,9 @@
;; Remove layout-item properties when moving a shape outside a layout
(cond-> (not (ctl/any-layout? objects frame-id))
(pcb/update-shapes moving-shapes-ids ctl/remove-layout-item-data))
;; Remove componnet-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-ids #(cond-> % (cfh/frame-shape? %) (assoc :hide-in-viewer true)))
(pcb/update-shapes shape-ids-to-detach ctk/detach-shape)
(pcb/change-parent frame-id moving-shapes drop-index)