mirror of
https://github.com/penpot/penpot.git
synced 2025-01-10 08:50:57 -05:00
🐛 Fix propagation when adding a shape to a component
This commit is contained in:
parent
9f08e3b9e5
commit
b5af51b751
1 changed files with 10 additions and 0 deletions
|
@ -770,6 +770,16 @@
|
||||||
(check-shape parent-id [parent-id])
|
(check-shape parent-id [parent-id])
|
||||||
shapes))))
|
shapes))))
|
||||||
|
|
||||||
|
(defmethod components-changed :add-obj
|
||||||
|
[file-data {:keys [parent-id page-id _component-id] :as change}]
|
||||||
|
(when page-id
|
||||||
|
(let [page (ctpl/get-page file-data page-id)
|
||||||
|
parents (map (partial ctn/get-shape page)
|
||||||
|
(cons parent-id (cfh/get-parent-ids (:objects page) parent-id)))
|
||||||
|
xform (comp (filter :main-instance)
|
||||||
|
(map :component-id))]
|
||||||
|
(into #{} xform parents))))
|
||||||
|
|
||||||
(defmethod components-changed :del-obj
|
(defmethod components-changed :del-obj
|
||||||
[file-data {:keys [id page-id _component-id] :as change}]
|
[file-data {:keys [id page-id _component-id] :as change}]
|
||||||
(when page-id
|
(when page-id
|
||||||
|
|
Loading…
Reference in a new issue