mirror of
https://github.com/penpot/penpot.git
synced 2025-06-06 02:11:38 +02:00
🐛 Fix problem when creating layout from selection
This commit is contained in:
parent
24fa4f71ad
commit
9af0e6ca44
1 changed files with 14 additions and 0 deletions
|
@ -183,6 +183,13 @@
|
||||||
(-> shape
|
(-> shape
|
||||||
(assoc :layout-item-h-sizing :auto
|
(assoc :layout-item-h-sizing :auto
|
||||||
:layout-item-v-sizing :auto))))
|
:layout-item-v-sizing :auto))))
|
||||||
|
;; Set the children to fixed to remove strange interactions
|
||||||
|
(dwc/update-shapes
|
||||||
|
selected
|
||||||
|
(fn [shape]
|
||||||
|
(-> shape
|
||||||
|
(assoc :layout-item-h-sizing :fix
|
||||||
|
:layout-item-v-sizing :fix))))
|
||||||
|
|
||||||
(ptk/data-event :layout/update [new-shape-id])
|
(ptk/data-event :layout/update [new-shape-id])
|
||||||
(dws/delete-shapes page-id selected)
|
(dws/delete-shapes page-id selected)
|
||||||
|
@ -204,6 +211,13 @@
|
||||||
(merge flex-params)
|
(merge flex-params)
|
||||||
(assoc :layout-item-h-sizing :auto
|
(assoc :layout-item-h-sizing :auto
|
||||||
:layout-item-v-sizing :auto))))
|
:layout-item-v-sizing :auto))))
|
||||||
|
;; Set the children to fixed to remove strange interactions
|
||||||
|
(dwc/update-shapes
|
||||||
|
selected
|
||||||
|
(fn [shape]
|
||||||
|
(-> shape
|
||||||
|
(assoc :layout-item-h-sizing :fix
|
||||||
|
:layout-item-v-sizing :fix))))
|
||||||
|
|
||||||
(ptk/data-event :layout/update [new-shape-id])
|
(ptk/data-event :layout/update [new-shape-id])
|
||||||
(dwu/commit-undo-transaction undo-id))))))))
|
(dwu/commit-undo-transaction undo-id))))))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue