X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2ec5dba3944805b06621cf11eb1f54948f85cdaa..f86a4930f2c69058684496a1882343fe8e709bf2:/src/osx/cocoa/window.mm?ds=sidebyside diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index 8580b52b5b..a12de97681 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -17,6 +17,7 @@ #include "wx/log.h" #include "wx/textctrl.h" #include "wx/combobox.h" + #include "wx/radiobut.h" #endif #ifdef __WXMAC__ @@ -686,8 +687,11 @@ void wxWidgetCocoaImpl::SetupMouseEvent( wxMouseEvent &wxevent , NSEvent * nsEve 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_wheelRotation = (int)deltaX; + wxevent.m_wheelRotation = -(int)deltaX; } else { @@ -1702,6 +1706,17 @@ void wxWidgetCocoaImpl::SetVisibility( bool visible ) [m_osxView setHidden:(visible ? NO:YES)]; } +double wxWidgetCocoaImpl::GetContentScaleFactor() const +{ +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + NSWindow* tlw = [m_osxView window]; + if ( [ tlw respondsToSelector:@selector(backingScaleFactor) ] ) + return [tlw backingScaleFactor]; + else +#endif + return 1.0; +} + // ---------------------------------------------------------------------------- // window animation stuff // ----------------------------------------------------------------------------