mirror of
https://github.com/penpot/penpot.git
synced 2025-06-01 11:51:41 +02:00
🐛 Fix is-main-of? calculation for v2 components
This commit is contained in:
parent
8f156a7fd0
commit
b9743891bb
3 changed files with 24 additions and 20 deletions
|
@ -138,10 +138,10 @@
|
|||
(= (:component-file shape) file-id)))
|
||||
|
||||
(defn is-main-of?
|
||||
[shape-main shape-inst]
|
||||
(and (:shape-ref shape-inst)
|
||||
(or (= (:shape-ref shape-inst) (:id shape-main))
|
||||
(= (:shape-ref shape-inst) (:shape-ref shape-main)))))
|
||||
[shape-main shape-inst components-v2]
|
||||
(or (= (:shape-ref shape-inst) (:id shape-main))
|
||||
(and (= (:shape-ref shape-inst) (:shape-ref shape-main))
|
||||
(not components-v2))))
|
||||
|
||||
(defn main-instance?
|
||||
"Check if this shape is the root of the main instance of some
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue