Skip to content

Commit

Permalink
Fix iOS touch location (bevyengine#1224)
Browse files Browse the repository at this point in the history
  • Loading branch information
enfipy authored and rparrett committed Jan 27, 2021
1 parent 894a6ef commit 3dc1310
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3dc1310

Please sign in to comment.