bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Make `SubCameraView` into a new primitive shape

Open ecoskey opened this issue 8 months ago • 6 comments

Step 2 of the camera restructure!

Motivation: In the proposal, I've stolen the SubView name to represent a component that requests a viewport proportional to the size of the render target managed by a compositor. Funnily enough, that means keeping the exact type definition of CameraSubView but using it for a different purpose, which I feel warrants splitting out the idea of a proportional "sub-rectangle" into its own type.

  • Renamed SubCameraView to SubRect and move to bevy_render::primitives (bikeshedding badly needed for the name)
  • added several utility methods. These mostly consume Self, with the idea being that most of the "frontend" components in the proposal are immutable.
  • renamed Camera::sub_view to Camera::crop and edited docs. I think this name better reflects its purpose of limiting the extents the camera actually renders to, and avoids conflicting with future alternate usage of "SubView"

Testing

  • Tested examples. They're currently broken lol

TODO:

  • [x] fix examples
  • [x] ~~fix SubRect::inset_by~~ (omitted from this pr, it's non-trivial I think)
  • [x] write migration guide

ecoskey avatar May 20 '25 00:05 ecoskey

It looks like your PR has been selected for a highlight in the next release blog post, but you didn't provide a release note.

Please review the instructions for writing release notes, then expand or revise the content in the release notes directory to showcase your changes.

github-actions[bot] avatar May 20 '25 00:05 github-actions[bot]

Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! You can review it at https://pixel-eagle.com/project/B04F67C0-C054-4A6F-92EC-F599FEC2FD1D?filter=PR-19302

If it's expected, please add the M-Deliberate-Rendering-Change label.

If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it.

github-actions[bot] avatar May 20 '25 00:05 github-actions[bot]

Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! You can review it at https://pixel-eagle.com/project/B04F67C0-C054-4A6F-92EC-F599FEC2FD1D?filter=PR-19302

If it's expected, please add the M-Deliberate-Rendering-Change label.

If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it.

github-actions[bot] avatar May 20 '25 06:05 github-actions[bot]

Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! You can review it at https://pixel-eagle.com/project/B04F67C0-C054-4A6F-92EC-F599FEC2FD1D?filter=PR-19302

If it's expected, please add the M-Deliberate-Rendering-Change label.

If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it.

github-actions[bot] avatar May 20 '25 06:05 github-actions[bot]

Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! You can review it at https://pixel-eagle.com/project/B04F67C0-C054-4A6F-92EC-F599FEC2FD1D?filter=PR-19302

If it's expected, please add the M-Deliberate-Rendering-Change label.

If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it.

github-actions[bot] avatar May 20 '25 06:05 github-actions[bot]

Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! You can review it at https://pixel-eagle.com/project/B04F67C0-C054-4A6F-92EC-F599FEC2FD1D?filter=PR-19302

If it's expected, please add the M-Deliberate-Rendering-Change label.

If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it.

github-actions[bot] avatar May 20 '25 07:05 github-actions[bot]