bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Add AutoMax next to ScalingMode::AutoMin

Open DasLixou opened this issue 2 years ago • 12 comments

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.

DasLixou avatar Nov 06 '22 15:11 DasLixou

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.

alice-i-cecile avatar Nov 06 '22 15:11 alice-i-cecile

Ok thanks for the great and fast feedback :) - Then ill just last the PR here and wait for more comments and problems etc

DasLixou avatar Nov 06 '22 15:11 DasLixou

I’ve been thinking about also adding an Custom / Closure ScalingMode for implementing own logic. Opinion?

DasLixou avatar Nov 13 '22 10:11 DasLixou

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.

alice-i-cecile avatar Nov 13 '22 13:11 alice-i-cecile

That would probably be the better solution… ok well than I’ll screw that idea 😅

DasLixou avatar Nov 13 '22 14:11 DasLixou

So is there something that I still have to do? @alice-i-cecile

DasLixou avatar Nov 13 '22 18:11 DasLixou

No, we just need another reviewer :) @bzm3r, can you review?

alice-i-cecile avatar Nov 13 '22 20:11 alice-i-cecile

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. :)

DasLixou avatar Nov 13 '22 20:11 DasLixou

There was a mirror typo in the other comment that needs to be fixed too :)

alice-i-cecile avatar Nov 13 '22 21:11 alice-i-cecile

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 😅

DasLixou avatar Nov 13 '22 21:11 DasLixou

Now everything should be fine - hopefully 😅

DasLixou avatar Nov 13 '22 21:11 DasLixou

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.

alice-i-cecile avatar Nov 13 '22 21:11 alice-i-cecile

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.

cart avatar Nov 14 '22 22:11 cart

bors r+

cart avatar Nov 14 '22 22:11 cart