Cocoa : bugfix #19591
authorDamien Plisson <damien.plisson@yahoo.fr>
Wed, 14 Oct 2009 09:46:41 +0000 (09:46 +0000)
committerDamien Plisson <damien.plisson@yahoo.fr>
Wed, 14 Oct 2009 09:46:41 +0000 (09:46 +0000)
Add trackpad 2 fingers gesture handling, to have it mimicking correctly mouse wheel, and thus zoom in/out correctly in the 3D view

intern/ghost/intern/GHOST_SystemCocoa.mm

index 3e0d58b46a6c95cf37c28f13f9a1c99860b0e350..072b2dfee865f14fc40c52821d164ab08f78464d 100644 (file)
@@ -1153,9 +1153,12 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
                case NSScrollWheel:
                        {
                                GHOST_TInt32 delta;
-                               delta = [event deltaY] > 0 ? 1 : -1;
-                               pushEvent(new GHOST_EventWheel(getMilliSeconds(), window, delta));
-
+                               
+                               double deltaF = [event deltaY];
+                               if (deltaF == 0.0) break; //discard trackpad delta=0 events
+                               
+                               delta = deltaF > 0.0 ? 1 : -1;
+                               pushEvent(new GHOST_EventWheel([event timestamp], window, delta));
                        }
                        break;