From 91c07d55730b7819e34d060854ba620977cd493d Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 12 Jun 2020 12:20:25 +0200 Subject: [PATCH] :bug: Properly handle grouping from multiple frames. --- frontend/src/uxbox/main/data/workspace.cljs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/frontend/src/uxbox/main/data/workspace.cljs b/frontend/src/uxbox/main/data/workspace.cljs index c5dc1b9012..6db57a55c8 100644 --- a/frontend/src/uxbox/main/data/workspace.cljs +++ b/frontend/src/uxbox/main/data/workspace.cljs @@ -1232,13 +1232,14 @@ ptk/WatchEvent (watch [_ state stream] (let [id (uuid/next) - selected (get-in state [:workspace-local :selected])] - (when (not-empty selected) - (let [page-id (get-in state [:workspace-page :id]) - objects (get-in state [:workspace-data page-id :objects]) - - items (map #(get objects %) selected) - selrect (geom/selection-rect items) + page-id (get-in state [:workspace-page :id]) + selected (get-in state [:workspace-local :selected]) + objects (get-in state [:workspace-data page-id :objects]) + items (->> selected + (map #(get objects %)) + (filter #(not= :frame (:type %))))] + (when (not-empty items) + (let [selrect (geom/selection-rect items) frame-id (-> items first :frame-id) parent-id (-> items first :parent-id) group (-> (group-shape id frame-id selected selrect)