From 12c6fa7e591545afe8c7101b0f021121eea7272f Mon Sep 17 00:00:00 2001 From: Tristan Guichaoua <33934311+tguichaoua@users.noreply.github.com> Date: Thu, 17 Aug 2023 18:59:07 +0200 Subject: [PATCH] Fix `Window::set_cursor_position` (#9456) # Objective Fixes #9455 This change has probably been forgotten in https://github.com/bevyengine/bevy/pull/8306. ## Solution Remove the inversion of the Y axis when propagates window change back to winit. --- crates/bevy_winit/src/system.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/crates/bevy_winit/src/system.rs b/crates/bevy_winit/src/system.rs index 92a3ec2ca9..0bf73553d2 100644 --- a/crates/bevy_winit/src/system.rs +++ b/crates/bevy_winit/src/system.rs @@ -174,13 +174,7 @@ pub(crate) fn changed_window( if window.physical_cursor_position() != cache.window.physical_cursor_position() { if let Some(physical_position) = window.physical_cursor_position() { - let inner_size = winit_window.inner_size(); - - let position = PhysicalPosition::new( - physical_position.x, - // Flip the coordinate space back to winit's context. - inner_size.height as f32 - physical_position.y, - ); + let position = PhysicalPosition::new(physical_position.x, physical_position.y); if let Err(err) = winit_window.set_cursor_position(position) { error!("could not set cursor position: {:?}", err);