From: Stefan Csomor Date: Sun, 28 Feb 2010 17:29:47 +0000 (+0000) Subject: translate 0.5 offset into user space before applying translation, see #11769, see... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e812e279ba1c7358956ec7809d60b6a27741af47 translate 0.5 offset into user space before applying translation, see #11769, see #11771 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63590 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/carbon/graphics.cpp b/src/osx/carbon/graphics.cpp index 03fd9e2c50..99e1921ebf 100644 --- a/src/osx/carbon/graphics.cpp +++ b/src/osx/carbon/graphics.cpp @@ -1461,14 +1461,18 @@ public : m_cg = cg; m_offset = offset; if ( m_offset ) - CGContextTranslateCTM( m_cg, (CGFloat) 0.5, (CGFloat) 0.5 ); + { + m_userOffset = CGContextConvertSizeToUserSpace( m_cg, CGSizeMake( 0.5 , 0.5 ) ); + CGContextTranslateCTM( m_cg, m_userOffset.width , m_userOffset.height ); + } } ~wxQuartzOffsetHelper( ) { if ( m_offset ) - CGContextTranslateCTM( m_cg, (CGFloat) -0.5, (CGFloat) -0.5 ); + CGContextTranslateCTM( m_cg, -m_userOffset.width , -m_userOffset.height ); } public : + CGSize m_userOffset; CGContextRef m_cg; bool m_offset; } ;