mirror of
https://github.com/penpot/penpot.git
synced 2025-02-10 09:08:31 -05:00
🐛 Fix copy paste can produce nested components in copies
This commit is contained in:
parent
291180816a
commit
55a821f193
1 changed files with 4 additions and 5 deletions
|
@ -312,14 +312,13 @@
|
|||
(defn components-nesting-loop?
|
||||
"Check if a nesting loop would be created if the given shape is moved below the given parent"
|
||||
[objects shape-id parent-id]
|
||||
(let [children (get-children-with-self objects shape-id)
|
||||
xf-get-component-id (keep :component-id)
|
||||
(let [xf-get-component-id (keep :component-id)
|
||||
|
||||
children (get-children-with-self objects shape-id)
|
||||
child-components (into #{} xf-get-component-id children)
|
||||
|
||||
parents (get-parents-with-self objects parent-id)
|
||||
xf-get-main-id (comp (filter :main-instance?)
|
||||
xf-get-component-id)
|
||||
parent-components (into #{} xf-get-main-id parents)]
|
||||
parent-components (into #{} xf-get-component-id parents)]
|
||||
(seq (set/intersection child-components parent-components))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
Loading…
Add table
Reference in a new issue