From 792145353ee728b46f8c061975ec0e81ea42df3a Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Tue, 16 Jan 2024 11:48:40 +0100 Subject: [PATCH] :bug: Fix calculate layout with hidden shapes --- common/src/app/common/geom/shapes/flex_layout/params.cljc | 4 +++- common/src/app/common/geom/shapes/grid_layout/params.cljc | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/common/src/app/common/geom/shapes/flex_layout/params.cljc b/common/src/app/common/geom/shapes/flex_layout/params.cljc index 4293dd53d..7bd1ce855 100644 --- a/common/src/app/common/geom/shapes/flex_layout/params.cljc +++ b/common/src/app/common/geom/shapes/flex_layout/params.cljc @@ -19,7 +19,9 @@ ([objects shapes parent] (when (d/not-empty? shapes) - (let [points + (let [shapes (->> shapes (remove :hidden)) + + points (->> shapes (map :id) (ctt/sort-z-index objects) diff --git a/common/src/app/common/geom/shapes/grid_layout/params.cljc b/common/src/app/common/geom/shapes/grid_layout/params.cljc index 16fcfd426..befd93e68 100644 --- a/common/src/app/common/geom/shapes/grid_layout/params.cljc +++ b/common/src/app/common/geom/shapes/grid_layout/params.cljc @@ -117,7 +117,8 @@ :layout-grid-rows [ctl/default-track-value ctl/default-track-value]} (ctl/create-cells [1 1 2 2])) - (let [all-shapes-rect (gco/shapes->rect shapes) + (let [shapes (->> shapes (remove :hidden)) + all-shapes-rect (gco/shapes->rect shapes) shapes+bounds (->> shapes (map #(vector % (grc/points->rect (get % :points)))))