]> git.saurik.com Git - wxWidgets.git/commitdiff
adapt to wx conventions for scroll wheel differences between horizontal and vertical...
authorStefan Csomor <csomor@advancedconcepts.ch>
Thu, 11 Jul 2013 19:31:21 +0000 (19:31 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Thu, 11 Jul 2013 19:31:21 +0000 (19:31 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74487 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/window.mm

index 3465cdbc408936b3962eb40019b03f132bda4555..a12de976819017833c66970fb46a3a21790aecdc 100644 (file)
@@ -687,8 +687,11 @@ void wxWidgetCocoaImpl::SetupMouseEvent( wxMouseEvent &wxevent , NSEvent * nsEve
                 
             if ( fabs(deltaX) > fabs(deltaY) )
             {
                 
             if ( fabs(deltaX) > fabs(deltaY) )
             {
+                // wx conventions for horizontal are inverted from vertical (originating from native msw behavior)
+                // right and up are positive values, left and down are negative values, while on OSX right and down
+                // are negative and left and up are positive.
                 wxevent.m_wheelAxis = wxMOUSE_WHEEL_HORIZONTAL;
                 wxevent.m_wheelAxis = wxMOUSE_WHEEL_HORIZONTAL;
-                wxevent.m_wheelRotation = (int)deltaX;
+                wxevent.m_wheelRotation = -(int)deltaX;
             }
             else
             {
             }
             else
             {