Skip to content

Commit

Permalink
Removed Mobile Touch event y-axis flip (#6597)
Browse files Browse the repository at this point in the history
# Objective

Fix android touch events being flipped.  Only removed test for android, don't have ios device to test with.  Tested with emulator and physical device.

## Solution

Remove check, no longer needed with coordinate change in 0.9
  • Loading branch information
slyedoc committed Nov 18, 2022
1 parent 2cd0bd7 commit cb8fe5b
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions crates/bevy_winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,15 +471,7 @@ pub fn winit_runner_with(mut app: App) {
}
},
WindowEvent::Touch(touch) => {
let mut location = touch.location.to_logical(window.scale_factor());

// On a mobile window, the start is from the top while on PC/Linux/OSX from
// bottom
if cfg!(target_os = "android") || cfg!(target_os = "ios") {
let window_height = windows.primary().height();
location.y = window_height - location.y;
}

let location = touch.location.to_logical(window.scale_factor());
world.send_event(converters::convert_touch_input(touch, location));
}
WindowEvent::ReceivedCharacter(c) => {
Expand Down

0 comments on commit cb8fe5b

Please sign in to comment.