Fix inverted Y-axis in window_pos_to_pixel() (#229)

- This fixes a regression caused by #228
This commit is contained in:
Jay Oster 2021-12-01 08:08:48 -08:00 committed by GitHub
parent c2454b01ab
commit b2b8f1140d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -521,7 +521,7 @@ impl Pixels {
let offset_height = pixels_height.min(physical_height) / 2.0; let offset_height = pixels_height.min(physical_height) / 2.0;
let pixel_x = (pos.x / pos.w + offset_width).floor() as isize; 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 if pixel_x < 0
|| pixel_x >= self.context.texture_extent.width as isize || pixel_x >= self.context.texture_extent.width as isize