0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-24 07:46:13 -05:00

Merge remote-tracking branch 'origin/staging' into develop

This commit is contained in:
Alejandro Alonso 2022-12-01 14:50:26 +01:00
commit ad491ccc8f
2 changed files with 15 additions and 6 deletions

View file

@ -325,12 +325,17 @@
x (:x data (- (:x vbc) (/ width 2))) x (:x data (- (:x vbc) (/ width 2)))
y (:y data (- (:y vbc) (/ height 2))) y (:y data (- (:y vbc) (/ height 2)))
page-id (:current-page-id state) page-id (:current-page-id state)
objects (wsh/lookup-page-objects state page-id)
frame-id (-> (wsh/lookup-page-objects state page-id) frame-id (-> (wsh/lookup-page-objects state page-id)
(ctst/top-nested-frame {:x frame-x :y frame-y})) (ctst/top-nested-frame {:x frame-x :y frame-y}))
selected (wsh/lookup-selected state)
page-objects (wsh/lookup-page-objects state) page-objects (wsh/lookup-page-objects state)
page-selected (wsh/lookup-selected state) base (cph/get-base-shape page-objects selected)
base (cph/get-base-shape page-objects page-selected) selected-frame? (and (= 1 (count selected))
parent-id (:parent-id base) (= :frame (get-in objects [(first selected) :type])))
parent-id (if
(or selected-frame? (empty? selected)) frame-id
(:parent-id base))
shape (-> (cts/make-minimal-shape type) shape (-> (cts/make-minimal-shape type)
(merge data) (merge data)

View file

@ -556,9 +556,13 @@
frame-id (ctst/top-nested-frame objects position) frame-id (ctst/top-nested-frame objects position)
selected (wsh/lookup-selected state) selected (wsh/lookup-selected state)
page-objects (wsh/lookup-page-objects state) page-objects (wsh/lookup-page-objects state)
page-selected (wsh/lookup-selected state) base (cph/get-base-shape page-objects selected)
base (cph/get-base-shape page-objects page-selected) selected-frame? (and (= 1 (count selected))
parent-id (:parent-id base) (= :frame (get-in objects [(first selected) :type])))
parent-id (if
(or selected-frame? (empty? selected)) frame-id
(:parent-id base))
[new-shape new-children] [new-shape new-children]
(create-svg-shapes svg-data position objects frame-id parent-id selected true) (create-svg-shapes svg-data position objects frame-id parent-id selected true)