Skip to content

Commit

Permalink
Merge pull request #2213 from cwensley/curtis/mac-fix-template-orient…
Browse files Browse the repository at this point in the history
…ation

Mac: Fix orientation when drawing template images
  • Loading branch information
cwensley authored May 4, 2022
2 parents 90ef239 + 55018ae commit 44977e5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Eto.Mac/Drawing/ImageHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down

0 comments on commit 44977e5

Please sign in to comment.