diff --git a/crates/bevy_picking/src/backend.rs b/crates/bevy_picking/src/backend.rs index 8c781d54e3..fb2f9d7d7a 100644 --- a/crates/bevy_picking/src/backend.rs +++ b/crates/bevy_picking/src/backend.rs @@ -229,11 +229,8 @@ pub mod ray { if !pointer_loc.is_in_viewport(camera, primary_window_entity) { return None; } - let mut viewport_pos = pointer_loc.position; - if let Some(viewport) = &camera.viewport { - let viewport_logical = camera.to_logical(viewport.physical_position)?; - viewport_pos -= viewport_logical; - } - camera.viewport_to_world(camera_tfm, viewport_pos).ok() + camera + .viewport_to_world(camera_tfm, pointer_loc.position) + .ok() } }