Skip to content

Commit

Permalink
No need to translate in X direction
Browse files Browse the repository at this point in the history
  • Loading branch information
kissandras committed Jan 7, 2021
1 parent 6570e8f commit 2e7a9be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/MacOSAppSupport/MAS_NSViewOffscreenContext.mm
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@
CGContextRef ctx = (CGContextRef) cgContext;
if (ctx != nil) {
if (orientation == Orientation::FlippedVertically) {
CGContextTranslateCTM (ctx, 1.0, height);
CGContextTranslateCTM (ctx, 0.0, height);
CGContextScaleCTM (ctx, 1.0, -1.0);
}
CGRect imgRect = CGRectMake (0, 0, width, height);
CGImageRef cgImage = [image CGImageForProposedRect: &imgRect context: [NSGraphicsContext currentContext] hints: nil];
CGContextDrawImage (ctx, imgRect, cgImage);
if (orientation == Orientation::FlippedVertically) {
CGContextScaleCTM (ctx, 1.0, -1.0);
CGContextTranslateCTM (ctx, 1.0, -height);
CGContextTranslateCTM (ctx, 0.0, -height);
}
}
}
Expand Down

0 comments on commit 2e7a9be

Please sign in to comment.