Merge remote-tracking branch 'origin/staging' into develop

This commit is contained in:
Andrey Antukh 2021-12-22 18:49:46 +01:00
commit 0cad1a1e7e
12 changed files with 105 additions and 106 deletions

View file

@ -261,20 +261,12 @@
(defn select-frames
[objects]
(let [root (get objects uuid/zero)
loopfn (fn loopfn [ids]
(let [id (first ids)
obj (get objects id)]
(cond
(or (nil? id) (nil? obj))
nil
(= :frame (:type obj))
(lazy-seq (cons obj (loopfn (rest ids))))
:else
(lazy-seq (loopfn (rest ids))))))]
(loopfn (:shapes root))))
(let [lookup #(get objects %)
frame? #(= :frame (:type %))
xform (comp (map lookup)
(filter frame?))]
(->> (:shapes (lookup uuid/zero))
(into [] xform))))
(defn clone-object
"Gets a copy of the object and all its children, with new ids