-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Merged by Bors] - Add AutoMax next to ScalingMode::AutoMin #6496
[Merged by Bors] - Add AutoMax next to ScalingMode::AutoMin #6496
Conversation
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 |
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 |
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this makes sense to me, but I am also a bit unsure about something.
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. :) |
@@ -244,6 +246,8 @@ impl CameraProjection for OrthographicProjection { | |||
max_width, | |||
max_height, | |||
} => { | |||
// Compare Pixels of current width and maximal height and Pixels of maximal width with current height. | |||
// Then use smaller (max_heigth when true) as what it referres to (height when true) and calculate rest so it can't get over maximum. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Then use smaller (max_heigth when true) as what it referres to (height when true) and calculate rest so it can't get over maximum. | |
// Then use smaller (max_height when true) as what it refers to (height when true) and calculate rest so it can't get over maximum. |
Co-authored-by: Alice Cecile <[email protected]>
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. |
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+ |
# 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. Co-authored-by: Lixou <[email protected]>
Pull request successfully merged into main. Build succeeded:
|
# 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. Co-authored-by: Lixou <[email protected]>
# 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. Co-authored-by: Lixou <[email protected]>
# 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. Co-authored-by: Lixou <[email protected]>
Objective
ScalingMode::Auto
for cameras only targets min_height and min_width, or as the docs say itUse 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 ofScalingMode::Auto
Changelog
Renamed
ScalingMode::Auto
toScalingMode::AutoMin
.Migration Guide
just rename
ScalingMode::Auto
toScalingMode::AutoMin
if you are using it.