mirror of
https://github.com/penpot/penpot.git
synced 2025-02-12 18:18:24 -05:00
🐛 Fix swap-slot is removed on copy-paste of a chained copy
This commit is contained in:
parent
89fa8ce66e
commit
c6fabc349e
1 changed files with 7 additions and 3 deletions
|
@ -486,6 +486,7 @@
|
||||||
duplicating-component? (or duplicating-component? (ctk/instance-head? obj))
|
duplicating-component? (or duplicating-component? (ctk/instance-head? obj))
|
||||||
is-component-main? (ctk/main-instance? obj)
|
is-component-main? (ctk/main-instance? obj)
|
||||||
subinstance-head? (ctk/subinstance-head? obj)
|
subinstance-head? (ctk/subinstance-head? obj)
|
||||||
|
instance-root? (ctk/instance-root? obj)
|
||||||
|
|
||||||
into-component? (and duplicating-component?
|
into-component? (and duplicating-component?
|
||||||
(ctn/in-any-component? objects parent))
|
(ctn/in-any-component? objects parent))
|
||||||
|
@ -508,7 +509,9 @@
|
||||||
:parent-id parent-id
|
:parent-id parent-id
|
||||||
:frame-id frame-id)
|
:frame-id frame-id)
|
||||||
|
|
||||||
(cond-> (and subinstance-head? remove-swap-slot?)
|
(cond-> (and (not instance-root?)
|
||||||
|
subinstance-head?
|
||||||
|
remove-swap-slot?)
|
||||||
(ctk/remove-swap-slot))
|
(ctk/remove-swap-slot))
|
||||||
|
|
||||||
(dissoc :shapes
|
(dissoc :shapes
|
||||||
|
@ -581,8 +584,9 @@
|
||||||
true
|
true
|
||||||
(and remove-swap-slot?
|
(and remove-swap-slot?
|
||||||
;; only remove swap slot of children when the current shape
|
;; only remove swap slot of children when the current shape
|
||||||
;; is not a subinstance head
|
;; is not a subinstance head nor a instance root
|
||||||
(not subinstance-head?))))
|
(not subinstance-head?)
|
||||||
|
(not instance-root?))))
|
||||||
changes
|
changes
|
||||||
(map (d/getf objects) (:shapes obj)))))))
|
(map (d/getf objects) (:shapes obj)))))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue