Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return URect instead of (UVec2, UVec2) in Camera::physical_viewport_rect #9085

Merged
merged 3 commits into from
Jul 15, 2023

Conversation

ameknite
Copy link
Contributor

@ameknite ameknite commented Jul 9, 2023

Objective

Continue #7867 now that we have URect #7984

  • Return URect instead of (UVec2, UVec2) in Camera::physical_viewport_rect
  • Add URect and IRect to prelude

Changelog

  • Changed Camera::physical_viewport_rect return type from (UVec2, UVec2) to URect
  • URect and IRect were added to prelude

Migration Guide

Before:

fn view_physical_camera_rect(camera_query: Query<&Camera>) {
    let camera = camera_query.single();
    let Some((min, max)) = camera.physical_viewport_rect() else { return };
    dbg!(min, max);
}

After:

fn view_physical_camera_rect(camera_query: Query<&Camera>) {
    let camera = camera_query.single();
    let Some(URect { min, max }) = camera.physical_viewport_rect() else { return };
    dbg!(min, max);
}

@alice-i-cecile alice-i-cecile added C-Code-Quality A section of code that is hard to understand or change A-Rendering Drawing game state to the screen M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide labels Jul 10, 2023
@james7132 james7132 added this to the 0.12 milestone Jul 10, 2023
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Jul 11, 2023
@james7132 james7132 added this pull request to the merge queue Jul 15, 2023
Merged via the queue into bevyengine:main with commit 7154b59 Jul 15, 2023
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Code-Quality A section of code that is hard to understand or change M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants