diff --git a/common/app/common/pages/changes.cljc b/common/app/common/pages/changes.cljc index 2d8fa5c67..681c40a26 100644 --- a/common/app/common/pages/changes.cljc +++ b/common/app/common/pages/changes.cljc @@ -36,11 +36,8 @@ (when verify? (us/verify ::spec/changes items)) - (reduce #(do - #_(prn "process-change" (:type %2) (:id %2)) - (or (process-change %1 %2) %1)) - data - items))) + (->> items + (reduce #(or (process-change %1 %2) %1) data)))) (defmethod process-change :set-option [data {:keys [page-id option value]}] diff --git a/frontend/src/app/main/ui/workspace/shapes.cljs b/frontend/src/app/main/ui/workspace/shapes.cljs index 15556ba6a..51f9e51e6 100644 --- a/frontend/src/app/main/ui/workspace/shapes.cljs +++ b/frontend/src/app/main/ui/workspace/shapes.cljs @@ -66,8 +66,6 @@ opts #js {:shape shape :frame frame} - 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) svg-element? (and (= (:type shape) :svg-raw) @@ -77,8 +75,7 @@ (when (and shape (not (:hidden shape))) [:* (if-not svg-element? - [:g.shape-wrapper {:style {:display (when hide-moving? "none") - :cursor (if alt? cur/duplicate nil)}} + [:g.shape-wrapper {:style {:display (when hide-moving? "none")}} (case (:type shape) :path [:> path/path-wrapper opts] :text [:> text/text-wrapper opts] diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/multiple.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/multiple.cljs index 319321a7c..586ad2906 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/multiple.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/multiple.cljs @@ -153,15 +153,8 @@ result))] (reduce extract-attrs [] shapes))) -;; TODO: Remove when added to rumext -(defn check-props - ([props] (check-props props =)) - ([props eqfn?] - (fn [np op] - (every? #(eqfn? (unchecked-get np %) (unchecked-get op %)) props)))) - (mf/defc options - {::mf/wrap [#(mf/memo' % (check-props ["shape" "shapes-with-children"]))] + {::mf/wrap [#(mf/memo' % (mf/check-props ["shape" "shapes-with-children"]))] ::mf/wrap-props false} [props] (let [shapes (unchecked-get props "shapes") diff --git a/frontend/src/app/main/ui/workspace/viewport.cljs b/frontend/src/app/main/ui/workspace/viewport.cljs index 8d75e685c..04c2b48cf 100644 --- a/frontend/src/app/main/ui/workspace/viewport.cljs +++ b/frontend/src/app/main/ui/workspace/viewport.cljs @@ -602,7 +602,7 @@ ;; This change is in an effect to minimize the sideffects of the cursor chaning ;; Changing a cursor will produce a "reflow" so we defer it until the component is rendered (mf/use-layout-effect - (mf/deps @cursor panning drawing-tool drawing-path?) + (mf/deps @cursor @alt? panning drawing-tool drawing-path?) (fn [] (let [new-cursor (cond @@ -614,6 +614,7 @@ (or (= drawing-tool :path) drawing-path?) cur/pen (= drawing-tool :curve) cur/pencil drawing-tool cur/create-shape + @alt? cur/duplicate :else cur/pointer-inner)] (when (not= @cursor new-cursor)