mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-27 12:20:58 +00:00
Update Editor::onMouseWheel() to use precise wheel as a touch device (scroll by default)
On OS X, when we receive a precise wheel event, it means that the user has pressed a touch-like device (trackpad, magic mouse, wacom tablet), so he can scroll by default with the device (it's not a real mouse wheel). The zoom can be done with the pinch gesture.
This commit is contained in:
parent
951bc1b4b0
commit
2a007bffb9
@ -47,12 +47,14 @@ bool StateWithWheelBehavior::onMouseWheel(Editor* editor, MouseMessage* msg)
|
|||||||
else
|
else
|
||||||
wheelAction = WHEEL_FG;
|
wheelAction = WHEEL_FG;
|
||||||
}
|
}
|
||||||
// Normal behavior: mouse wheel zooms
|
// Normal behavior: mouse wheel zooms If the message is from a
|
||||||
else if (Preferences::instance().editor.zoomWithWheel()) {
|
// precise wheel i.e. a trackpad/touch-like device, we scroll by
|
||||||
|
// default.
|
||||||
|
else if (Preferences::instance().editor.zoomWithWheel() &&
|
||||||
|
!msg->preciseWheel()) {
|
||||||
if (msg->ctrlPressed())
|
if (msg->ctrlPressed())
|
||||||
wheelAction = WHEEL_FRAME;
|
wheelAction = WHEEL_FRAME;
|
||||||
else if ((msg->wheelDelta().x != 0 && !msg->preciseWheel()) ||
|
else if (msg->wheelDelta().x != 0 || msg->shiftPressed())
|
||||||
(msg->shiftPressed()))
|
|
||||||
wheelAction = WHEEL_HSCROLL;
|
wheelAction = WHEEL_HSCROLL;
|
||||||
else
|
else
|
||||||
wheelAction = WHEEL_ZOOM;
|
wheelAction = WHEEL_ZOOM;
|
||||||
|
Loading…
Reference in New Issue
Block a user