From 6dd81604dd874bbc2db742a526ebf288c0b4031a Mon Sep 17 00:00:00 2001 From: Nivaldo Date: Mon, 23 Nov 2026 14:07:14 -0300 Subject: [PATCH] native/macos: don't shift the mouse y by one pixel locationInWindow is continuous with the origin at the bottom-left, so flipping it to a top-left origin is height - y. The extra - 1 made every mouse position read one backing pixel too high. X11 and Windows report the position unchanged. Co-Authored-By: Claude Opus 5.5 --- src/native/macos.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/macos.rs b/src/native/macos.rs index b8d01fdef..ce97a48c0 100644 --- a/src/native/macos.rs +++ b/src/native/macos.rs @@ -155,7 +155,7 @@ impl MacosDisplay { fn transform_mouse_point(&self, point: &NSPoint) -> (f32, f32) { let d = native_display().lock().unwrap(); let new_x = point.x as f32 * d.dpi_scale; - let new_y = d.screen_height as f32 - (point.y as f32 * d.dpi_scale) - 1.; + let new_y = d.screen_height as f32 - (point.y as f32 * d.dpi_scale); (new_x, new_y) }