diff --git a/common/src/app/common/types/shape_tree.cljc b/common/src/app/common/types/shape_tree.cljc index 95204a523..f8e50a6cb 100644 --- a/common/src/app/common/types/shape_tree.cljc +++ b/common/src/app/common/types/shape_tree.cljc @@ -211,14 +211,21 @@ ;; Check which index is lower :else ;; If the base is a layout we should check if the z-index property is set - (let [[z-index-a z-index-b] - (if (ctl/any-layout? objects base-id) + (let [layer-order? (ctl/any-layout? objects base-id) + [z-index-a z-index-b] + (if layer-order? [(ctl/layout-z-index objects (dm/get-in objects [base-id :shapes index-a])) (ctl/layout-z-index objects (dm/get-in objects [base-id :shapes index-b]))] [0 0])] - (if (= z-index-a z-index-b) + (cond + (and (= z-index-a z-index-b) (not layer-order?)) + (< index-a index-b) + + (and (= z-index-a z-index-b) layer-order?) (> index-a index-b) + + :else (< z-index-a z-index-b)))))) (defn sort-z-index diff --git a/frontend/src/app/main/render.cljs b/frontend/src/app/main/render.cljs index 0e3e95429..a8efca58a 100644 --- a/frontend/src/app/main/render.cljs +++ b/frontend/src/app/main/render.cljs @@ -208,7 +208,6 @@ (let [objects (:objects data) shapes (cfh/get-immediate-children objects) dim (calculate-dimensions objects aspect-ratio) - _ (prn ">>DIM" dim) vbox (format-viewbox dim) bgcolor (dm/get-in data [:options :background] default-color)