diff --git a/common/src/app/common/types/shape_tree.cljc b/common/src/app/common/types/shape_tree.cljc index c5bc32dc19..a6455e5d93 100644 --- a/common/src/app/common/types/shape_tree.cljc +++ b/common/src/app/common/types/shape_tree.cljc @@ -320,12 +320,12 @@ (get-viewer-frames objects nil)) ([objects {:keys [all-frames?]}] - (into [] - (comp (map (d/getf objects)) - (if all-frames? - identity - (remove :hide-in-viewer))) - (sort-z-index objects (get-frames-ids objects))))) + (->> (get-frames objects) + (sort-z-index-objects objects) + (into [] + (if all-frames? + (map identity) + (remove :hide-in-viewer)))))) (defn start-page-index [objects]