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.
This commit is contained in:
Tristan Guichaoua 2023-08-17 18:59:07 +02:00 committed by Carter Anderson
parent 7a3fe8fe5d
commit 12c6fa7e59

View file

@ -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);