aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-07-13 16:05:29 -0400
committerDavid Robillard <d@drobilla.net>2024-07-13 16:05:29 -0400
commitd5959095d8ea8e3adfa661f622d7f1d2c2771c49 (patch)
treecb922c8ff46b804db3a22bde4d68f01aad933b18
parent143861758f472340d887978f1afb1b1d3a5130bc (diff)
downloadpugl-d5959095d8ea8e3adfa661f622d7f1d2c2771c49.tar.gz
pugl-d5959095d8ea8e3adfa661f622d7f1d2c2771c49.tar.bz2
pugl-d5959095d8ea8e3adfa661f622d7f1d2c2771c49.zip
MacOS: Fix expose event coordinates
-rw-r--r--src/mac.m5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mac.m b/src/mac.m
index cf7e8d2..abbbf34 100644
--- a/src/mac.m
+++ b/src/mac.m
@@ -326,11 +326,14 @@ dispatchCurrentChildViewConfiguration(PuglView* const view)
return;
}
+ const double viewY = (double)puglview->lastConfigure.height -
+ ((rect.origin.y + rect.size.height) * scaleFactor);
+
const PuglExposeEvent ev = {
PUGL_EXPOSE,
0,
(PuglCoord)(rect.origin.x * scaleFactor),
- (PuglCoord)(rect.origin.y * scaleFactor),
+ (PuglCoord)viewY,
(PuglSpan)(rect.size.width * scaleFactor),
(PuglSpan)(rect.size.height * scaleFactor),
};