Fix iOS touch location (#1224)

This commit is contained in:
David Ackerman 2021-01-07 23:37:22 +02:00 committed by GitHub
parent 599f381a6a
commit 0e0906d22e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -329,8 +329,8 @@ pub fn winit_runner_with(mut app: App, mut event_loop: EventLoop<()>) {
let winit_window = winit_windows.get_window(window_id).unwrap();
let mut location = touch.location.to_logical(winit_window.scale_factor());
// FIXME?: On Android window start is top while on PC/Linux/OSX on bottom
if cfg!(target_os = "android") {
// 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.get_primary().unwrap().height();
location.y = window_height - location.y;
}