changeset 11192:d1c7e1786e87 12+12

8218424: Use precise scrolling only when supported Summary: use different event properties in case external mouse is used on mac Reviewed-by: prr Contributed-by: jose.pereda@gluonhq.com
author jvos
date Thu, 07 Feb 2019 19:40:31 +0100
parents a22ff97ad01c
children 9ad3ee98867c
files modules/javafx.graphics/src/main/native-glass/mac/GlassViewDelegate.m
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/modules/javafx.graphics/src/main/native-glass/mac/GlassViewDelegate.m	Fri Feb 01 20:10:38 2019 +0100
+++ b/modules/javafx.graphics/src/main/native-glass/mac/GlassViewDelegate.m	Thu Feb 07 19:40:31 2019 +0100
@@ -455,9 +455,17 @@
     jdouble rotationY = 0.0;
     if (type == com_sun_glass_events_MouseEvent_WHEEL)
     {
-        rotationX = (jdouble)[theEvent scrollingDeltaX] * 0.1;
-        rotationY = (jdouble)[theEvent scrollingDeltaY] * 0.1;
-
+        if ([theEvent hasPreciseScrollingDeltas])
+        {
+            rotationX = (jdouble)[theEvent scrollingDeltaX] * 0.1;
+            rotationY = (jdouble)[theEvent scrollingDeltaY] * 0.1;
+        }
+        else
+        {
+            rotationX = (jdouble)[theEvent deltaX];
+            rotationY = (jdouble)[theEvent deltaY];
+        }
+        
         //XXX: check for equality for doubles???
         if (rotationX == 0.0 && rotationY == 0.0)
         {