🐛 Fix 'upate main component' and 'reset overrides' shows in context menu of untouched copies

This commit is contained in:
Pablo Alba 2023-05-31 18:14:45 +02:00 committed by Andrés Moya
parent 531d640d38
commit a89d47b5c5
4 changed files with 47 additions and 21 deletions

View file

@ -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]

View file

@ -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]