[aseprite] 165/196: Update Editor::onMouseWheel() to use precise wheel as a touch device (scroll by default)

Tobias Hansen thansen at moszumanska.debian.org
Wed Apr 20 18:50:16 UTC 2016


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit 2a007bffb9391e0e6901e3eca4f1b1e13a107e47
Author: David Capello <davidcapello at gmail.com>
Date:   Mon Apr 11 12:59:51 2016 -0300

    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.
---
 src/app/ui/editor/state_with_wheel_behavior.cpp | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/app/ui/editor/state_with_wheel_behavior.cpp b/src/app/ui/editor/state_with_wheel_behavior.cpp
index d30aae4..f1f8ec4 100644
--- a/src/app/ui/editor/state_with_wheel_behavior.cpp
+++ b/src/app/ui/editor/state_with_wheel_behavior.cpp
@@ -47,12 +47,14 @@ bool StateWithWheelBehavior::onMouseWheel(Editor* editor, MouseMessage* msg)
     else
       wheelAction = WHEEL_FG;
   }
-  // Normal behavior: mouse wheel zooms
-  else if (Preferences::instance().editor.zoomWithWheel()) {
+  // Normal behavior: mouse wheel zooms If the message is from a
+  // precise wheel i.e. a trackpad/touch-like device, we scroll by
+  // default.
+  else if (Preferences::instance().editor.zoomWithWheel() &&
+           !msg->preciseWheel()) {
     if (msg->ctrlPressed())
       wheelAction = WHEEL_FRAME;
-    else if ((msg->wheelDelta().x != 0 && !msg->preciseWheel()) ||
-             (msg->shiftPressed()))
+    else if (msg->wheelDelta().x != 0 || msg->shiftPressed())
       wheelAction = WHEEL_HSCROLL;
     else
       wheelAction = WHEEL_ZOOM;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list