From e33b2f6b0cea6d6263990aa9abe6a69fdfba5973 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 11 Nov 2023 18:28:28 -0500 Subject: 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. --- src/mac_cairo.m | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/mac_cairo.m b/src/mac_cairo.m index 8e28985..e4d2f5f 100644 --- a/src/mac_cairo.m +++ b/src/mac_cairo.m @@ -93,10 +93,8 @@ puglMacCairoEnter(PuglView* view, const PuglExposeEvent* expose) const CGSize sizePx = {(CGFloat)view->lastConfigure.width, (CGFloat)view->lastConfigure.height}; - const CGSize sizePt = CGContextConvertSizeToUserSpace(context, sizePx); - // Convert coordinates to standard Cairo space - CGContextTranslateCTM(context, 0.0, -sizePt.height); + CGContextTranslateCTM(context, 0.0, sizePx.height * scale); CGContextScaleCTM(context, scale, -scale); drawView->surface = cairo_quartz_surface_create_for_cg_context( -- cgit v1.2.1