🐛 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

@ -25,6 +25,7 @@
- Fix hidden toolbar click event still available [Taiga #10437](https://tree.taiga.io/project/penpot/us/10437)
- Fix hovering over templates [Taiga #10545](https://tree.taiga.io/project/penpot/issue/10545)
- Fix problem with default shadows value in plugins [Plugins #191](https://github.com/penpot/penpot-plugins/issues/191)
- Fix problem with constraints when creating group [Taiga #10455](https://tree.taiga.io/project/penpot/issue/10455)
## 2.5.4

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)