From 55018ae08eaadbb694277694a4f254fcab882e2e Mon Sep 17 00:00:00 2001 From: Curtis Wensley Date: Wed, 4 May 2022 13:24:08 -0700 Subject: [PATCH] Mac: Fix orientation when drawing template images --- src/Eto.Mac/Drawing/ImageHandler.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Eto.Mac/Drawing/ImageHandler.cs b/src/Eto.Mac/Drawing/ImageHandler.cs index 8b8c685466..765c51060e 100644 --- a/src/Eto.Mac/Drawing/ImageHandler.cs +++ b/src/Eto.Mac/Drawing/ImageHandler.cs @@ -75,7 +75,9 @@ public virtual void DrawTemplateImage(GraphicsHandler graphics, RectangleF sourc var ctx = graphics.Control; ctx.SaveState(); - if (graphics.GraphicsContext.IsFlipped) + var image = GetImage(); + + if (!image.Flipped) { // draw flipped ctx.ConcatCTM(new CGAffineTransform(1, 0, 0, -1, 0, graphics.ViewHeight)); @@ -96,7 +98,7 @@ public virtual void DrawTemplateImage(GraphicsHandler graphics, RectangleF sourc } var destRect = destination.ToNS(); - var cgImage = GetImage().AsCGImage(ref destRect, graphics.GraphicsContext, null); + var cgImage = image.AsCGImage(ref destRect, graphics.GraphicsContext, null); // clip to the image as a mask, using only alpha channel ctx.ClipToMask(destMask.ToNS(), cgImage);