mirror of
https://github.com/penpot/penpot.git
synced 2025-02-10 17:18:21 -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?
|
(defn components-nesting-loop?
|
||||||
"Check if a nesting loop would be created if the given shape is moved below the given parent"
|
"Check if a nesting loop would be created if the given shape is moved below the given parent"
|
||||||
[objects shape-id parent-id]
|
[objects shape-id parent-id]
|
||||||
(let [children (get-children-with-self objects shape-id)
|
(let [xf-get-component-id (keep :component-id)
|
||||||
xf-get-component-id (keep :component-id)
|
|
||||||
|
children (get-children-with-self objects shape-id)
|
||||||
child-components (into #{} xf-get-component-id children)
|
child-components (into #{} xf-get-component-id children)
|
||||||
|
|
||||||
parents (get-parents-with-self objects parent-id)
|
parents (get-parents-with-self objects parent-id)
|
||||||
xf-get-main-id (comp (filter :main-instance?)
|
parent-components (into #{} xf-get-component-id parents)]
|
||||||
xf-get-component-id)
|
|
||||||
parent-components (into #{} xf-get-main-id parents)]
|
|
||||||
(seq (set/intersection child-components parent-components))))
|
(seq (set/intersection child-components parent-components))))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
Loading…
Add table
Reference in a new issue