diff --git a/frontend/src/uxbox/main/data/workspace.cljs b/frontend/src/uxbox/main/data/workspace.cljs index 80c445033..ea1456909 100644 --- a/frontend/src/uxbox/main/data/workspace.cljs +++ b/frontend/src/uxbox/main/data/workspace.cljs @@ -1169,17 +1169,19 @@ (defn impl-match-by-selrect [state selrect] - (let [page-id (::page-id state) + (let [zoom (gpt/point (get-in state [:workspace-local :zoom])) + selrect' (geom/apply-zoom selrect zoom) + page-id (::page-id state) data (get-in state [:workspace-data page-id]) match (fn [acc {:keys [type id] :as shape}] (cond (helpers/is-shape-grouped (:id shape) (:objects data)) acc - (geom/contained-in? shape selrect) + (geom/contained-in? shape selrect') (conj acc id) - (geom/overlaps? shape selrect) + (geom/overlaps? shape selrect') (conj acc id) :else diff --git a/frontend/src/uxbox/main/geom.cljs b/frontend/src/uxbox/main/geom.cljs index 6cfd0a121..bda881a26 100644 --- a/frontend/src/uxbox/main/geom.cljs +++ b/frontend/src/uxbox/main/geom.cljs @@ -701,6 +701,14 @@ ;; --- Helpers +(defn apply-zoom + [selrect zoom] + (assoc selrect + :x (/ (:x selrect) (:x zoom)) + :y (/ (:y selrect) (:y zoom)) + :width (/ (:width selrect) (:x zoom)) + :height (/ (:height selrect) (:y zoom)))) + (defn contained-in? "Check if a shape is contained in the provided selection rect."