mirror of
https://github.com/penpot/penpot.git
synced 2026-09-18 18:06:14 +00:00
🐛 Make create component children scale
This commit is contained in:
parent
26af5c7847
commit
e36dce372a
@ -39,6 +39,7 @@
|
|||||||
[it shapes objects page-id file-id components-v2 prepare-create-group prepare-create-board]
|
[it shapes objects page-id file-id components-v2 prepare-create-group prepare-create-board]
|
||||||
(let [changes (pcb/empty-changes it page-id)
|
(let [changes (pcb/empty-changes it page-id)
|
||||||
|
|
||||||
|
from-singe-frame? (and (= 1 (count shapes)) (-> shapes first cfh/frame-shape?))
|
||||||
[root changes old-root-ids]
|
[root changes old-root-ids]
|
||||||
(if (and (= (count shapes) 1)
|
(if (and (= (count shapes) 1)
|
||||||
(or (and (= (:type (first shapes)) :group) (not components-v2))
|
(or (and (= (:type (first shapes)) :group) (not components-v2))
|
||||||
@ -72,6 +73,15 @@
|
|||||||
|
|
||||||
[root changes (map :id shapes)]))
|
[root changes (map :id shapes)]))
|
||||||
|
|
||||||
|
changes
|
||||||
|
(cond-> changes
|
||||||
|
(not from-singe-frame?)
|
||||||
|
(pcb/update-shapes
|
||||||
|
(:shapes root)
|
||||||
|
(fn [shape]
|
||||||
|
(-> shape
|
||||||
|
(assoc :constraints-h :scale :constraints-v :scale)))))
|
||||||
|
|
||||||
objects' (assoc objects (:id root) root)
|
objects' (assoc objects (:id root) root)
|
||||||
|
|
||||||
[root-shape changes] (generate-add-component-changes changes root objects' file-id page-id components-v2)
|
[root-shape changes] (generate-add-component-changes changes root objects' file-id page-id components-v2)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user