mirror of
https://github.com/penpot/penpot.git
synced 2025-06-02 03:31:37 +02:00
🐛 Fix paste groups without shapes attr
This commit is contained in:
parent
30c786741f
commit
e7a82579c1
3 changed files with 16 additions and 5 deletions
|
@ -1820,9 +1820,14 @@
|
|||
detach? (or (foreign-instance? shape paste-objects state)
|
||||
(and (ctk/in-component-copy-not-root? shape)
|
||||
(not= (:id component-shape)
|
||||
(:id component-shape-parent))))]
|
||||
(:id component-shape-parent))))
|
||||
assign-shapes? (and (or (cph/group-shape? shape)
|
||||
(cph/bool-shape? shape))
|
||||
(nil? (:shapes shape)))]
|
||||
(-> shape
|
||||
(assoc :frame-id frame-id :parent-id parent-id)
|
||||
(cond-> assign-shapes?
|
||||
(assoc :shapes []))
|
||||
(cond-> detach?
|
||||
(->
|
||||
;; this is used later, if the paste needs to create a new component from the detached shape
|
||||
|
|
|
@ -409,6 +409,8 @@
|
|||
|
||||
:else
|
||||
(let [frame? (cph/frame-shape? obj)
|
||||
group? (cph/group-shape? obj)
|
||||
bool? (cph/bool-shape? obj)
|
||||
new-id (ids-map (:id obj))
|
||||
parent-id (or parent-id frame-id)
|
||||
name (:name obj)
|
||||
|
@ -427,8 +429,12 @@
|
|||
:name name
|
||||
:parent-id parent-id
|
||||
:frame-id frame-id)
|
||||
(dissoc :shapes
|
||||
:main-instance?
|
||||
|
||||
(cond->
|
||||
(or group? bool?)
|
||||
(assoc :shapes []))
|
||||
|
||||
(dissoc :main-instance?
|
||||
:use-for-thumbnail?)
|
||||
(gsh/move delta)
|
||||
(d/update-when :interactions #(ctsi/remap-interactions % ids-map objects)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue