From b2b8f1140dca42c2fe61b8a4d7d3bb4b4cb83a8e Mon Sep 17 00:00:00 2001 From: Jay Oster Date: Wed, 1 Dec 2021 08:08:48 -0800 Subject: [PATCH] Fix inverted Y-axis in window_pos_to_pixel() (#229) - This fixes a regression caused by #228 --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index ebb8c81..920e873 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -521,7 +521,7 @@ impl Pixels { let offset_height = pixels_height.min(physical_height) / 2.0; let pixel_x = (pos.x / pos.w + offset_width).floor() as isize; - let pixel_y = (-pos.y / pos.w + offset_height).floor() as isize; + let pixel_y = (pos.y / pos.w + offset_height).floor() as isize; if pixel_x < 0 || pixel_x >= self.context.texture_extent.width as isize