Skip to content
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

Adjust orthographic camera gizmo with respect to keep_aspect setting #90690

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

jsjtxietian
Copy link
Contributor

@jsjtxietian jsjtxietian commented Apr 15, 2024

Fixes #90589

@MajorMcDoom
Copy link
Contributor

Thanks for tackling this!

A couple of issues:

  • When using Keep Height, the aspect ratio is no longer maintained. Instead, it's always a square.
  • When using Keep Height, the handle is still placed on the right side of the gizmo, instead of on the top. This means it's visually reflecting the width, and using that resulting value to set a value that will become the height, which is wrong.
    CameraAspectBug

@MajorMcDoom
Copy link
Contributor

I've attached an image of the expected behaviour when the size is set to 2.0. Hope this helps!
CorrectBehaviour

@jsjtxietian
Copy link
Contributor Author

jsjtxietian commented Apr 16, 2024

I see, thanks for your help!

It should feel more correct now.

@MajorMcDoom
Copy link
Contributor

I see, thanks for your help!

It should feel more correct now.

Works correctly now as far as I can tell! Just waiting for a review now. Thanks again. :)

@KoBeWi KoBeWi modified the milestones: 4.3, 4.4 Jul 30, 2024
Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, it works as expected. Both Keep Height and Keep Width orthgographic gizmos render correctly now, even if the base aspect ratio is changed in the project settings (when changing the window width/height project settings).

Code looks good to me.

Before After
Before After

Example of the sizes being correct now:

Screenshot_20240807_015230 png webp

Screenshot_20240807_015240 png webp

@akien-mga akien-mga changed the title Adjust orthographic camera gizmo with respect to "keep_aspect" setting Adjust orthographic camera gizmo with respect to keep_aspect setting Aug 16, 2024
@akien-mga akien-mga merged commit 195a174 into godotengine:master Aug 16, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Orthographic camera gizmo does not respect "keep_aspect" setting
5 participants