mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 11:18:36 +00:00
🐛 Fix stale accumulator in get-children-in-instance recursion
get-children-rec passed the original children vector to each recursive call instead of the updated one that already includes the current shape. This caused descendant results to be accumulated from the wrong starting point, losing intermediate shapes. Pass children' (which includes the current shape) into every recursive call. Signed-off-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
parent
08ca561667
commit
ff41d08e3c
@ -106,8 +106,9 @@
|
||||
(let [shape (get objects id)]
|
||||
(if (and (ctk/instance-head? shape) (seq children))
|
||||
children
|
||||
(into (conj children shape)
|
||||
(mapcat #(get-children-rec children %) (:shapes shape))))))]
|
||||
(let [children' (conj children shape)]
|
||||
(into children'
|
||||
(mapcat #(get-children-rec children' %) (:shapes shape)))))))]
|
||||
(get-children-rec [] id)))
|
||||
|
||||
(defn get-component-shape
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user