From 5a17237015f3a8bbe7c9750d0173f36f57f27681 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 25 Nov 2020 17:03:30 +0100 Subject: [PATCH] :paperclip: Minor cosmetic fixes on workspace shape wrapper component. --- frontend/src/app/main/ui/workspace/shapes.cljs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/shapes.cljs b/frontend/src/app/main/ui/workspace/shapes.cljs index 52cb95040..2652591d4 100644 --- a/frontend/src/app/main/ui/workspace/shapes.cljs +++ b/frontend/src/app/main/ui/workspace/shapes.cljs @@ -90,23 +90,21 @@ on-mouse-enter (use-mouse-enter shape) on-mouse-leave (use-mouse-leave shape) + alt? (hooks/use-rxsub ms/keyboard-alt) + moving-iref (mf/use-memo (mf/deps (:id shape)) #(make-is-moving-ref (:id shape))) moving? (mf/deref moving-iref)] - (hooks/use-stream ms/keyboard-alt #(reset! alt? %)) - (mf/use-effect - (fn [] - (fn [] - (on-mouse-leave)))) + (constantly on-mouse-leave)) (when (and shape (or ghost? (not moving?)) (not (:hidden shape))) [:g.shape-wrapper {:on-mouse-enter on-mouse-enter :on-mouse-leave on-mouse-leave - :style {:cursor (if @alt? cur/duplicate nil)}} + :style {:cursor (if alt? cur/duplicate nil)}} (case (:type shape) :path [:> path/path-wrapper opts] :text [:> text/text-wrapper opts]