diff options
author | Lluis Sanchez <lluis@xamarin.com> | 2013-11-08 16:39:37 +0400 |
---|---|---|
committer | Lluis Sanchez <lluis@xamarin.com> | 2013-11-08 16:40:01 +0400 |
commit | 67a97ff70ffd5b488a4073ae7abad2173054c6c5 (patch) | |
tree | d866978ade3574ab397c4d5a79503b371a9553ea /Xwt.Mac | |
parent | d410f30c53b46aac9c2dc6b5eca57af1a2c828c9 (diff) |
[Mac] Fix vector image rendering issue
Flip the image if the target surface is not flipped.
Diffstat (limited to 'Xwt.Mac')
-rw-r--r-- | Xwt.Mac/Xwt.Mac/ImageHandler.cs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Xwt.Mac/Xwt.Mac/ImageHandler.cs b/Xwt.Mac/Xwt.Mac/ImageHandler.cs index 65b2f5fe..ec7acb77 100644 --- a/Xwt.Mac/Xwt.Mac/ImageHandler.cs +++ b/Xwt.Mac/Xwt.Mac/ImageHandler.cs @@ -261,6 +261,11 @@ namespace Xwt.Mac public void DrawIt (NSObject ob) { CGContext ctx = NSGraphicsContext.CurrentContext.GraphicsPort; + if (!NSGraphicsContext.CurrentContext.IsFlipped) { + // Custom drawing is done using flipped order, so if the target surface is not flipped, we need to flip it + ctx.TranslateCTM (0, Size.Height); + ctx.ScaleCTM (1, -1); + } DrawInContext (ctx); } |