aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-11-11 18:28:28 -0500
committerDavid Robillard <d@drobilla.net>2023-11-11 18:28:28 -0500
commite33b2f6b0cea6d6263990aa9abe6a69fdfba5973 (patch)
treecbb0bfa98b22c7fb42025596ccc26266f2e98e8b
parent98bd60abe8f34dbbe538b6f85f5f5c02550b5236 (diff)
downloadpugl-main.tar.gz
pugl-main.tar.bz2
pugl-main.zip
MacOS: Fix Cairo rendering on some systemsHEADmain
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.
-rw-r--r--src/mac_cairo.m4
1 files changed, 1 insertions, 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(