bevy
bevy copied to clipboard
Add AutoMax next to ScalingMode::AutoMin
Objective
ScalingMode::Auto
for cameras only targets min_height and min_width, or as the docs say it Use minimal possible viewport size while keeping the aspect ratio.
But there is no ScalingMode that targets max_height and Max_width or Use maximal possible viewport size while keeping the aspect ratio.
Solution
Added ScalingMode::AutoMax
that does the exact opposite of ScalingMode::Auto
Changelog
Renamed ScalingMode::Auto
to ScalingMode::AutoMin
.
Migration Guide
just rename ScalingMode::Auto
to ScalingMode::AutoMin
if you are using it.
Great first PR, thanks! I'm not going to merge this for 0.9, to avoid creating more work for the migration guide authors, but I expect this will be on main
very shortly after.
Ok thanks for the great and fast feedback :) - Then ill just last the PR here and wait for more comments and problems etc
I’ve been thinking about also adding an Custom / Closure ScalingMode for implementing own logic. Opinion?
Might be a good choice, but belongs in its own PR. I'm unsure how useful that would be: feels more complicated and less flexible than being able to dynamically change this in a system with a Manual
option.
That would probably be the better solution… ok well than I’ll screw that idea 😅
So is there something that I still have to do? @alice-i-cecile
No, we just need another reviewer :) @bzm3r, can you review?
But if you want to know if it’s working as expected - I’m using it in my game and it works as it should. :)
There was a mirror typo in the other comment that needs to be fixed too :)
There was a mirror typo in the other comment that needs to be fixed too :)
Whoops - I’ll fix it :) - isn’t that simple with a German autocorrection and a smartphone 😅
Now everything should be fine - hopefully 😅
Awesome! This is now ready to be merged, but because it's a breaking change I'm going to hold off until after 0.9.1 drops to reduce the amount of cherrypicking needed.
Awesome! This is now ready to be merged, but because it's a breaking change I'm going to hold off until after 0.9.1 drops to reduce the amount of cherrypicking needed.
I'm cool with merging things now. I'd prefer not to hold back our dev processes for patch releases when cherry picking is straightforward.
bors r+
Pull request successfully merged into main.
Build succeeded:
- build-and-install-on-iOS
- build-android
- build (macos-latest)
- build (ubuntu-latest)
- build-wasm
- build (windows-latest)
- build-without-default-features (bevy)
- build-without-default-features (bevy_ecs)
- build-without-default-features (bevy_reflect)
- check-compiles
- check-doc
- check-missing-examples-in-docs
- ci
- markdownlint
- run-examples
- run-examples-on-wasm
- run-examples-on-windows-dx12