Skip to content

Commit 12c6fa7

Browse files
tguichaouacart
authored andcommitted
Fix Window::set_cursor_position (#9456)
# Objective Fixes #9455 This change has probably been forgotten in #8306. ## Solution Remove the inversion of the Y axis when propagates window change back to winit.
1 parent 7a3fe8f commit 12c6fa7

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

crates/bevy_winit/src/system.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,7 @@ pub(crate) fn changed_window(
174174

175175
if window.physical_cursor_position() != cache.window.physical_cursor_position() {
176176
if let Some(physical_position) = window.physical_cursor_position() {
177-
let inner_size = winit_window.inner_size();
178-
179-
let position = PhysicalPosition::new(
180-
physical_position.x,
181-
// Flip the coordinate space back to winit's context.
182-
inner_size.height as f32 - physical_position.y,
183-
);
177+
let position = PhysicalPosition::new(physical_position.x, physical_position.y);
184178

185179
if let Err(err) = winit_window.set_cursor_position(position) {
186180
error!("could not set cursor position: {:?}", err);

0 commit comments

Comments
 (0)