-
-
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
Respect viewport position in coordinate conversion functions #17633
base: main
Are you sure you want to change the base?
Conversation
b7e8a03
to
47772ea
Compare
Good migration guide, but yes, bug fix :) |
47772ea
to
6e5febb
Compare
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.
6e5febb
to
9ba38ac
Compare
9ba38ac
to
9bd7b58
Compare
Polished the example quite a bit
|
@tychedelia would appreciate another test of the example, since I think the scale_override behaviour on Windows might be bit different than MacOS defaults. |
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.
Looks great and even more improved! Thanks.
Objective
Camera::viewport_to_world_2d
,Camera::viewport_to_world
,Camera::world_to_viewport
andCamera::world_to_viewport_with_depth
, the results were incorrect when theCamera::viewport
field was configured with a viewport position that was non-zero. This PR attempts to correct that.Camera::viewport_to_world_2d
doesn't take into account the viewport position #16200Solution
2d_viewport_to_world
example to test the functions with a dynamic viewport position and size, camera positions and zoom levels. It is probably worth discussing whether to change the example, add a new one or just completely skip touching the examples.Testing
Used the modified example to test the functions with dynamic camera transform as well as dynamic viewport size and position.