0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-11 01:28:30 -05:00

🐛 Fix resize/rotate with mouse buttons different than left

This commit is contained in:
alonso.torres 2021-07-07 14:12:47 +02:00 committed by Andrés Moya
parent 7b9b3dabbe
commit 73a08fd119
3 changed files with 28 additions and 12 deletions

View file

@ -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

View file

@ -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

View file

@ -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))))