mirror of
https://github.com/penpot/penpot.git
synced 2025-06-01 21:41:41 +02:00
🐛 Fix 'upate main component' and 'reset overrides' shows in context menu of untouched copies
This commit is contained in:
parent
531d640d38
commit
a89d47b5c5
4 changed files with 47 additions and 21 deletions
|
@ -224,7 +224,6 @@
|
|||
pos (d/index-of shapes id)]
|
||||
(if (= 0 pos) nil (nth shapes (dec pos)))))
|
||||
|
||||
|
||||
(defn get-immediate-children
|
||||
"Retrieve resolved shape objects that are immediate children
|
||||
of the specified shape-id"
|
||||
|
@ -303,6 +302,13 @@
|
|||
(ctkl/get-component file id))
|
||||
(assoc :type type)))
|
||||
|
||||
(defn component-touched?
|
||||
"Check if any shape in the component is touched"
|
||||
[objects root-id]
|
||||
(->> (get-children-with-self objects root-id)
|
||||
(filter (comp seq :touched))
|
||||
seq))
|
||||
|
||||
(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]
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
(if (some? (:main-instance-id component))
|
||||
(get-in component [:objects (:main-instance-id component)])
|
||||
(get-in component [:objects (:id component)])))
|
||||
|
||||
|
||||
(defn uses-library-components?
|
||||
"Check if the shape uses any component in the given library."
|
||||
[shape library-id]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue