Skip to content

Commit 0e0906d

Browse files
authored
Fix iOS touch location (#1224)
1 parent 599f381 commit 0e0906d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/bevy_winit/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ pub fn winit_runner_with(mut app: App, mut event_loop: EventLoop<()>) {
329329
let winit_window = winit_windows.get_window(window_id).unwrap();
330330
let mut location = touch.location.to_logical(winit_window.scale_factor());
331331

332-
// FIXME?: On Android window start is top while on PC/Linux/OSX on bottom
333-
if cfg!(target_os = "android") {
332+
// On a mobile window, the start is from the top while on PC/Linux/OSX from bottom
333+
if cfg!(target_os = "android") || cfg!(target_os = "ios") {
334334
let window_height = windows.get_primary().unwrap().height();
335335
location.y = window_height - location.y;
336336
}

0 commit comments

Comments
 (0)