diff --git a/frontend/src/app/main/ui/workspace/shapes.cljs b/frontend/src/app/main/ui/workspace/shapes.cljs index 1996ed140..0383ef143 100644 --- a/frontend/src/app/main/ui/workspace/shapes.cljs +++ b/frontend/src/app/main/ui/workspace/shapes.cljs @@ -76,8 +76,7 @@ shape (-> (geom/transform-shape shape) (geom/translate-to-frame frame)) opts #js {:shape shape - :frame frame - :pointer-events (when (:blocked shape) "none")} + :frame frame} svg-element? (and (= (:type shape) :svg-raw) (not= :svg (get-in shape [:content :tag])))] diff --git a/frontend/src/app/main/ui/workspace/viewport.cljs b/frontend/src/app/main/ui/workspace/viewport.cljs index 2023e73d8..57bf77568 100644 --- a/frontend/src/app/main/ui/workspace/viewport.cljs +++ b/frontend/src/app/main/ui/workspace/viewport.cljs @@ -92,7 +92,7 @@ (and (some? drawing-obj) (= :path (:type drawing-obj)))) text-editing? (and edition (= :text (get-in objects [edition :type]))) - on-click (actions/on-click hover selected edition drawing-path?) + on-click (actions/on-click hover selected edition drawing-path? drawing-tool) on-context-menu (actions/on-context-menu hover) on-double-click (actions/on-double-click hover hover-ids drawing-path? objects) on-drag-enter (actions/on-drag-enter) @@ -117,7 +117,7 @@ show-draw-area? drawing-obj show-gradient-handlers? (= (count selected) 1) show-grids? (contains? layout :display-grid) - show-outlines? (and (nil? transform) (not edition) (not drawing-obj)) + show-outlines? (and (nil? transform) (not edition) (not drawing-obj) (not (#{:comments :path} drawing-tool))) show-pixel-grid? (>= zoom 8) show-presence? page-id show-prototypes? (= options-mode :prototype) diff --git a/frontend/src/app/main/ui/workspace/viewport/actions.cljs b/frontend/src/app/main/ui/workspace/viewport/actions.cljs index dee7b8115..1115991a9 100644 --- a/frontend/src/app/main/ui/workspace/viewport/actions.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/actions.cljs @@ -34,7 +34,8 @@ (mf/use-callback (mf/deps id blocked hidden type drawing-tool text-editing? edition edit-path selected) (fn [bevent] - (when (dom/class? (dom/get-target bevent) "viewport-controls") + (when (or (dom/class? (dom/get-target bevent) "viewport-controls") + (dom/class? (dom/get-target bevent) "viewport-selrect")) (dom/stop-propagation bevent) (let [event (.-nativeEvent bevent) @@ -58,9 +59,9 @@ (when (and (not= edition id) text-editing?) (st/emit! dw/clear-edition-mode)) - (when (and (or (not edition) (not= edition id)) (not blocked) (not hidden)) + (when (and (or (not edition) (not= edition id)) (not blocked) (not hidden) (not (#{:comments :path} drawing-tool))) (cond - (and drawing-tool (not (#{:comments :path} drawing-tool))) + drawing-tool (st/emit! (dd/start-drawing drawing-tool)) (and edit-path (contains? edit-path edition)) @@ -119,11 +120,12 @@ (reset! frame-hover nil)))) (defn on-click - [hover selected edition drawing-path?] + [hover selected edition drawing-path? drawing-tool] (mf/use-callback - (mf/deps @hover selected edition drawing-path?) + (mf/deps @hover selected edition drawing-path? drawing-tool) (fn [event] - (when (dom/class? (dom/get-target event) "viewport-controls") + (when (or (dom/class? (dom/get-target event) "viewport-controls") + (dom/class? (dom/get-target event) "viewport-selrect")) (let [ctrl? (kbd/ctrl? event) shift? (kbd/shift? event) alt? (kbd/alt? event) @@ -133,7 +135,13 @@ selected? (contains? selected (:id @hover))] (st/emit! (ms/->MouseEvent :click ctrl? shift? alt?)) - (when (and hovering? (not shift?) (not frame?) (not selected?) (not edition) (not drawing-path?)) + (when (and hovering? + (not shift?) + (not frame?) + (not selected?) + (not edition) + (not drawing-path?) + (not (#{:comments :path} drawing-tool))) (st/emit! (dw/select-shape (:id @hover))))))))) (defn on-double-click diff --git a/frontend/src/app/main/ui/workspace/viewport/drawarea.cljs b/frontend/src/app/main/ui/workspace/viewport/drawarea.cljs index fd1d179fd..f8d4b6fd2 100644 --- a/frontend/src/app/main/ui/workspace/viewport/drawarea.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/drawarea.cljs @@ -26,7 +26,8 @@ [{:keys [shape zoom tool] :as props}] [:g.draw-area - [:& shapes/shape-wrapper {:shape shape}] + [:g {:style {:pointer-events "none"}} + [:& shapes/shape-wrapper {:shape shape}]] (case tool :path [:& path-editor {:shape shape :zoom zoom}]