mirror of
https://github.com/penpot/penpot.git
synced 2025-05-17 23:56:11 +02:00
🐛 Fix resize/rotate with mouse buttons different than left
This commit is contained in:
parent
7b9b3dabbe
commit
73a08fd119
3 changed files with 28 additions and 12 deletions
|
@ -26,8 +26,9 @@
|
||||||
- Fix color-input wrong behavior (on workspace page color) [Taiga #1795](https://tree.taiga.io/project/penpot/issue/1795).
|
- 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 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 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 negative values in blur [Taiga #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 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
|
### :arrow_up: Deps updates
|
||||||
### :boom: Breaking changes
|
### :boom: Breaking changes
|
||||||
|
|
|
@ -286,12 +286,17 @@
|
||||||
|
|
||||||
shape-center (geom/center-shape shape)
|
shape-center (geom/center-shape shape)
|
||||||
|
|
||||||
on-resize (fn [current-position _initial-position event]
|
on-resize
|
||||||
(dom/stop-propagation event)
|
(fn [current-position _initial-position event]
|
||||||
(st/emit! (dw/start-resize current-position selected shape)))
|
(when (dom/left-mouse? event)
|
||||||
|
(dom/stop-propagation event)
|
||||||
|
(st/emit! (dw/start-resize current-position selected shape))))
|
||||||
|
|
||||||
on-rotate #(do (dom/stop-propagation %)
|
on-rotate
|
||||||
(st/emit! (dw/start-rotate shapes)))]
|
(fn [event]
|
||||||
|
(when (dom/left-mouse? event)
|
||||||
|
(dom/stop-propagation event)
|
||||||
|
(st/emit! (dw/start-rotate shapes))))]
|
||||||
|
|
||||||
[:*
|
[:*
|
||||||
[:& controls {:shape shape
|
[:& controls {:shape shape
|
||||||
|
@ -311,13 +316,19 @@
|
||||||
shape (geom/transform-shape shape {:round-coords? false})
|
shape (geom/transform-shape shape {:round-coords? false})
|
||||||
|
|
||||||
shape' (if (debug? :simple-selection) (geom/setup {:type :rect} (geom/selection-rect [shape])) shape)
|
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)
|
on-resize
|
||||||
(st/emit! (dw/start-resize current-position #{shape-id} shape')))
|
(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
|
on-rotate
|
||||||
#(do (dom/stop-propagation %)
|
(fn [event]
|
||||||
(st/emit! (dw/start-rotate [shape])))]
|
(when (dom/left-mouse? event)
|
||||||
|
(dom/stop-propagation event)
|
||||||
|
(st/emit! (dw/start-rotate [shape]))))]
|
||||||
|
|
||||||
[:& controls {:shape shape'
|
[:& controls {:shape shape'
|
||||||
:zoom zoom
|
:zoom zoom
|
||||||
:color color
|
:color color
|
||||||
|
|
|
@ -375,3 +375,7 @@
|
||||||
(trigger-download-uri filename mtype uri)))))
|
(trigger-download-uri filename mtype uri)))))
|
||||||
|
|
||||||
(trigger-download-uri filename mtype uri)))
|
(trigger-download-uri filename mtype uri)))
|
||||||
|
|
||||||
|
(defn left-mouse? [bevent]
|
||||||
|
(let [event (.-nativeEvent bevent)]
|
||||||
|
(= 1 (.-which event))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue