🐛 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:
Andrey Antukh 2026-04-14 12:30:35 +00:00
parent 08ca561667
commit ff41d08e3c

View File

@ -106,8 +106,9 @@
(let [shape (get objects id)] (let [shape (get objects id)]
(if (and (ctk/instance-head? shape) (seq children)) (if (and (ctk/instance-head? shape) (seq children))
children children
(into (conj children shape) (let [children' (conj children shape)]
(mapcat #(get-children-rec children %) (:shapes shape))))))] (into children'
(mapcat #(get-children-rec children' %) (:shapes shape)))))))]
(get-children-rec [] id))) (get-children-rec [] id)))
(defn get-component-shape (defn get-component-shape