From a14686c9f3d8e17a38d59e808a63ad65e4eab695 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 13 Jan 2021 20:25:24 +0100 Subject: [PATCH] :bug: Hides grid when moving a frame --- frontend/src/app/main/ui/workspace/frame_grid.cljs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/frame_grid.cljs b/frontend/src/app/main/ui/workspace/frame_grid.cljs index 88b200096..eb4e3a4d3 100644 --- a/frontend/src/app/main/ui/workspace/frame_grid.cljs +++ b/frontend/src/app/main/ui/workspace/frame_grid.cljs @@ -10,6 +10,7 @@ (ns app.main.ui.workspace.frame-grid (:require [rumext.alpha :as mf] + [okulary.core :as l] [app.main.refs :as refs] [app.common.math :as mth] [app.common.pages :as cp] @@ -81,10 +82,17 @@ :row [:> layout-grid props])))))) +(def shapes-moving-ref + (let [moving-shapes (fn [local] + (when (= :move (:transform local)) + (:selected local)))] + (l/derived moving-shapes refs/workspace-local))) + (mf/defc frame-grid [{:keys [zoom]}] - (let [frames (mf/deref refs/workspace-frames)] + (let [frames (mf/deref refs/workspace-frames) + shapes-moving (mf/deref shapes-moving-ref)] [:g.grid-display {:style {:pointer-events "none"}} - (for [frame frames] + (for [frame (->> frames (remove #(contains? shapes-moving (:id %))))] [:& grid-display-frame {:key (str "grid-" (:id frame)) :zoom zoom :frame (gsh/transform-shape frame)}])]))