-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Remove OrthographicProjection.scale (adopted) #15075
Conversation
Just workin' through the CI failures now... |
@@ -176,6 +177,6 @@ fn fit_canvas( | |||
let h_scale = event.width / RES_WIDTH as f32; | |||
let v_scale = event.height / RES_HEIGHT as f32; | |||
let mut projection = projections.single_mut(); | |||
projection.scale = 1. / h_scale.min(v_scale).round(); | |||
projection.scaling_mode = ScalingMode::WindowSize(h_scale.min(v_scale).round()); |
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.
Note: this appears to produce the same behaviour as the existing example, though if there's a simpler method I haven't seen that's great too!
...and now I know |
It looks like your PR is a breaking change, but you didn't provide a migration guide. Could you add some context on what users should update when this change get released in a new version of Bevy? |
/// Note: scaling can be set by [`scaling_mode`](Self::scaling_mode) as well. | ||
/// This parameter scales on top of that. |
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.
This makes it pretty easy to scale multiple variants of ScalingMode
since you can just modify a single f32
. Are we at all concerned about hurting ergonomics?
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.
Not particularly; projects will only need to handle this once, and the majority of projects will have a single scaling mode.
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've also run into a few people now who miss the existence of ScalingMode
because of scale
, leading them to ask questions. In this way, I think it's hurting them by not just making them think up front about how the camera should be configured.
@richchurcher let me know when merge conflicts are resolved and I'll get this in for you :) |
# Objective Add examples for zooming (and orbiting) orthographic and perspective cameras. I'm pretty green with 3D, so please treat with suspicion! I note that if/when #15075 is merged, `.scale` will go away so this example uses `.scaling_mode`. Closes #2580 --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com> Co-authored-by: Jan Hohenheim <jan@hohenheim.ch>
4370a27
to
0c3fedd
Compare
@alice-i-cecile I think we should be good now! |
Objective
Hello! I am adopting #11022 to resolve conflicts with
main
. tldr: this removesscale
in favour ofscaling_mode
. Please see the original PR for explanation/discussion.Also relates to #2580.
Migration Guide
Replace all uses of
scale
withscaling_mode
, keeping in mind thatscale
is (was) a multiplier. For example, replacewith