🐛 Fix problem with constraints when creating group

This commit is contained in:
alonso.torres 2025-03-19 15:24:25 +01:00 committed by Aitor Moreno
parent d01eccf912
commit 3a80120bf6
2 changed files with 9 additions and 0 deletions

View file

@ -120,6 +120,14 @@
(pcb/with-page-id page-id)
(pcb/with-objects objects)
(pcb/add-object group {:index group-idx})
;; Create a group needs to reset the constraints to scale/scale
(pcb/update-shapes
(map :id shapes)
(fn [shape]
(-> shape
(d/assoc-when :constraints-h :scale)
(d/assoc-when :constraints-v :scale))))
(pcb/update-shapes (map :id shapes) ctl/remove-layout-item-data)
(pcb/change-parent (:id group) (reverse shapes))
(pcb/update-shapes (map :id shapes-to-detach) ctk/detach-shape)