Removed Mobile Touch event y-axis flip (#6597)
# 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
This commit is contained in:
parent
2cd0bd7575
commit
cb8fe5b7fd
@ -471,15 +471,7 @@ pub fn winit_runner_with(mut app: App) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
WindowEvent::Touch(touch) => {
|
WindowEvent::Touch(touch) => {
|
||||||
let mut location = touch.location.to_logical(window.scale_factor());
|
let 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
world.send_event(converters::convert_touch_input(touch, location));
|
world.send_event(converters::convert_touch_input(touch, location));
|
||||||
}
|
}
|
||||||
WindowEvent::ReceivedCharacter(c) => {
|
WindowEvent::ReceivedCharacter(c) => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user