From d0244e0befcc811ea5835f47d592445f52716e01 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Fri, 5 Jan 2024 13:18:11 +0100 Subject: [PATCH] :bug: Fix problem with masks --- common/src/app/common/geom/bounds_map.cljc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/common/src/app/common/geom/bounds_map.cljc b/common/src/app/common/geom/bounds_map.cljc index 769c7d5535..55230c9c0b 100644 --- a/common/src/app/common/geom/bounds_map.cljc +++ b/common/src/app/common/geom/bounds_map.cljc @@ -31,13 +31,13 @@ (create-bounds shape bounds-map objects modif-tree nil)) ([{:keys [id] :as shape} bounds-map objects modif-tree current-ref] - (cond - (and (cfh/mask-shape? shape) (d/not-empty? (:shapes shape))) - (create-bounds (get objects (first (:shapes shape))) bounds-map objects modif-tree) - - (cfh/group-shape? shape) + (if (cfh/group-shape? shape) (let [modifiers (dm/get-in modif-tree [id :modifiers]) - children (cfh/get-immediate-children objects id) + + children + (cond->> (cfh/get-immediate-children objects id) + (cfh/mask-shape? shape) + (take 1)) shape-bounds (if current-ref @current-ref @(get bounds-map id)) current-bounds (cond-> shape-bounds @@ -49,7 +49,7 @@ (mapv #(deref (get bounds-map (:id %)))))] (gpo/merge-parent-coords-bounds children-bounds current-bounds)) - :else + ;; Shape (let [modifiers (dm/get-in modif-tree [id :modifiers]) shape-bounds (if current-ref @current-ref @(get bounds-map id))] (cond-> shape-bounds