mirror of
https://github.com/penpot/penpot.git
synced 2025-04-09 13:31:23 -05:00
🐛 Fix copies have select color wrong
This commit is contained in:
parent
f76f4615cf
commit
340fe75204
1 changed files with 12 additions and 8 deletions
|
@ -113,22 +113,26 @@
|
|||
:else
|
||||
(get-component-shape objects (get objects (:parent-id shape)) options))))
|
||||
|
||||
(defn in-component-main?
|
||||
"Check if the shape is inside a component non-main instance.
|
||||
|
||||
Note that we must iterate on the parents because non-root shapes in
|
||||
a main component have not any discriminating attribute."
|
||||
|
||||
(defn component-main?
|
||||
"Check if the shape is a component main instance or is inside one."
|
||||
[objects shape]
|
||||
(let [component-shape (get-component-shape objects shape {:allow-main? true})]
|
||||
(:main-instance component-shape)))
|
||||
(cond
|
||||
(or (nil? shape) (cph/root? shape))
|
||||
false
|
||||
(ctk/main-instance? shape)
|
||||
true
|
||||
:else
|
||||
(component-main? objects (get objects (:parent-id shape)))))
|
||||
|
||||
(defn in-any-component?
|
||||
"Check if the shape is part of any component (main or copy), wether it's
|
||||
head or not."
|
||||
[objects shape]
|
||||
(or (ctk/in-component-copy? shape)
|
||||
(ctk/main-instance? shape)
|
||||
(in-component-main? objects shape)))
|
||||
(ctk/instance-head? shape)
|
||||
(component-main? objects shape)))
|
||||
|
||||
(defn make-component-shape
|
||||
"Clone the shape and all children. Generate new ids and detach
|
||||
|
|
Loading…
Add table
Reference in a new issue