aboutsummaryrefslogtreecommitdiffstats
path: root/src
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 /src
parent98bd60abe8f34dbbe538b6f85f5f5c02550b5236 (diff)
downloadpugl-e33b2f6b0cea6d6263990aa9abe6a69fdfba5973.tar.gz
pugl-e33b2f6b0cea6d6263990aa9abe6a69fdfba5973.tar.bz2
pugl-e33b2f6b0cea6d6263990aa9abe6a69fdfba5973.zip
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.
Diffstat (limited to 'src')
-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(