Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed (Vec2, Vec2) to Rect in Camera::logical_viewport_rect (#7867)
# Objective `Camera::logical_viewport_rect()` returns `Option<(Vec2, Vec2)>` which is a tuple of vectors representing the `(min, max)` bounds of the viewport rect. Since the function says it returns a rect and there is a `Rect { min, max }` struct in `bevy_math`, using the struct will be clearer. ## Solution Replaced `Option<(Vec2, Vec2)>` with `Option<Rect>` for `Camera::logical_viewport_rect()`. --- ## Changelog - Changed `Camera::logical_viewport_rect` return type from `(Vec2, Vec2)` to `Rect` ## Migration Guide Before: ``` fn view_logical_camera_rect(camera_query: Query<&Camera>) { let camera = camera_query.single(); let Some((min, max)) = camera.logical_viewport_rect() else { return }; dbg!(min, max); } ``` After: ``` fn view_logical_camera_rect(camera_query: Query<&Camera>) { let camera = camera_query.single(); let Some(Rect { min, max }) = camera.logical_viewport_rect() else { return }; dbg!(min, max); } ```
- Loading branch information