diff --git a/CHANGES.md b/CHANGES.md index ef92386dd..f48579f1b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -26,8 +26,9 @@ - Fix color-input wrong behavior (on workspace page color) [Taiga #1795](https://tree.taiga.io/project/penpot/issue/1795). - Fix file contextual menu in shared libraries at dashboard [Taiga #1865](https://tree.taiga.io/project/penpot/issue/1865). - Fix problem with color picker and fonts [#1049](https://github.com/penpot/penpot/issues/1049) -- Fix negative values in blur [#1815](https://tree.taiga.io/project/penpot/issue/1815) -- Fix problem when editing color in group [#1816](https://tree.taiga.io/project/penpot/issue/1816) +- Fix negative values in blur [Taiga #1815](https://tree.taiga.io/project/penpot/issue/1815) +- Fix problem when editing color in group [Taiga #1816](https://tree.taiga.io/project/penpot/issue/1816) +- Fix resize/rotate with mouse buttons different than left [#1060](https://github.com/penpot/penpot/issues/1060) ### :arrow_up: Deps updates ### :boom: Breaking changes diff --git a/frontend/src/app/main/ui/workspace/viewport/selection.cljs b/frontend/src/app/main/ui/workspace/viewport/selection.cljs index 4f853229c..f1d894a2b 100644 --- a/frontend/src/app/main/ui/workspace/viewport/selection.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/selection.cljs @@ -286,12 +286,17 @@ shape-center (geom/center-shape shape) - on-resize (fn [current-position _initial-position event] - (dom/stop-propagation event) - (st/emit! (dw/start-resize current-position selected shape))) + on-resize + (fn [current-position _initial-position event] + (when (dom/left-mouse? event) + (dom/stop-propagation event) + (st/emit! (dw/start-resize current-position selected shape)))) - on-rotate #(do (dom/stop-propagation %) - (st/emit! (dw/start-rotate shapes)))] + on-rotate + (fn [event] + (when (dom/left-mouse? event) + (dom/stop-propagation event) + (st/emit! (dw/start-rotate shapes))))] [:* [:& controls {:shape shape @@ -311,13 +316,19 @@ shape (geom/transform-shape shape {:round-coords? false}) shape' (if (debug? :simple-selection) (geom/setup {:type :rect} (geom/selection-rect [shape])) shape) - on-resize (fn [current-position _initial-position event] - (dom/stop-propagation event) - (st/emit! (dw/start-resize current-position #{shape-id} shape'))) + + on-resize + (fn [current-position _initial-position event] + (when (dom/left-mouse? event) + (dom/stop-propagation event) + (st/emit! (dw/start-resize current-position #{shape-id} shape')))) on-rotate - #(do (dom/stop-propagation %) - (st/emit! (dw/start-rotate [shape])))] + (fn [event] + (when (dom/left-mouse? event) + (dom/stop-propagation event) + (st/emit! (dw/start-rotate [shape]))))] + [:& controls {:shape shape' :zoom zoom :color color diff --git a/frontend/src/app/util/dom.cljs b/frontend/src/app/util/dom.cljs index b14de52b3..f05f2a1a5 100644 --- a/frontend/src/app/util/dom.cljs +++ b/frontend/src/app/util/dom.cljs @@ -375,3 +375,7 @@ (trigger-download-uri filename mtype uri))))) (trigger-download-uri filename mtype uri))) + +(defn left-mouse? [bevent] + (let [event (.-nativeEvent bevent)] + (= 1 (.-which event))))