mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
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:
parent
7a3fe8fe5d
commit
12c6fa7e59
1 changed files with 1 additions and 7 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue