From 021db427c30a79eef63ddc980b66a24c9dcab659 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Thu, 11 Sep 2008 18:55:45 +0000 Subject: [PATCH] adding missing y axis flip git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55559 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/carbon/graphics.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/osx/carbon/graphics.cpp b/src/osx/carbon/graphics.cpp index 2ae8e6388d..436b9f8dd1 100644 --- a/src/osx/carbon/graphics.cpp +++ b/src/osx/carbon/graphics.cpp @@ -103,8 +103,13 @@ OSStatus wxMacDrawCGImage( #if wxOSX_USE_CARBON return HIViewDrawCGImage( inContext, inBounds, inImage ); #else - // todo flip - CGContextDrawImage(inContext, *inBounds, inImage ); + CGContextSaveGState(inContext); + CGContextTranslateCTM(inContext, inBounds->origin.x, inBounds->origin.y + inBounds->size.height); + CGRect r = *inBounds; + r.origin.x = r.origin.y = 0; + CGContextScaleCTM(inContext, 1, -1); + CGContextDrawImage(inContext, r, inImage ); + CGContextRestoreGState(inContext); return noErr; #endif } -- 2.45.2