Skip to content

Commit e33b2f6

Browse files
committed
MacOS: Fix Cairo rendering on some systems
CGContextConvertSizeToUserSpace returns a negative height on some systems and a positive height on others. I have no idea why, but only basic scaling is required here, so just avoid this function entirely.
1 parent 98bd60a commit e33b2f6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/mac_cairo.m

+1-3
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,8 @@ - (void)drawRect:(NSRect)rect
9393
const CGSize sizePx = {(CGFloat)view->lastConfigure.width,
9494
(CGFloat)view->lastConfigure.height};
9595

96-
const CGSize sizePt = CGContextConvertSizeToUserSpace(context, sizePx);
97-
9896
// Convert coordinates to standard Cairo space
99-
CGContextTranslateCTM(context, 0.0, -sizePt.height);
97+
CGContextTranslateCTM(context, 0.0, sizePx.height * scale);
10098
CGContextScaleCTM(context, scale, -scale);
10199

102100
drawView->surface = cairo_quartz_surface_create_for_cg_context(

0 commit comments

Comments
 (0)