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

Fix scaling not working after resizing the window #699

Merged
merged 5 commits into from
Mar 30, 2022
Merged

Fix scaling not working after resizing the window #699

merged 5 commits into from
Mar 30, 2022

Conversation

voylin
Copy link
Contributor

@voylin voylin commented Mar 29, 2022

Scaling didn't work after resizing the window. In Godot 4, the
SubViewport also has a size changed signal which should be used instead.
This fixes the issue I was having: #698
Tested this in the demo project and my personal project, everything seems to work find again.

The main changes were switching the stretch mode to the new Godot 4 mode Canvas_items like @Calinou suggested. And the viewport change should happen on the SubViewport _size_changed as that one updates later compared to the root viewport, which had more control over the size of the SubViewport for some reason.

Ps.: This is my first pull request ever so I'm not sure if I did a good job explaining everything.

Scaling didn't work after resizing the window. In Godot 4, the
SubViewport also has a size changed signal which should be used instead.
viewport/3d_scaling/hud.gd Outdated Show resolved Hide resolved
viewport/3d_scaling/hud.gd Outdated Show resolved Hide resolved
Copy link
Member

@aaronfranke aaronfranke left a comment

Choose a reason for hiding this comment

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

Looks good. I'll squash-and-merge this.

@aaronfranke aaronfranke changed the title Fix for issue #698 Fix scaling not working after resizing the window Mar 30, 2022
@aaronfranke
Copy link
Member

aaronfranke commented Mar 30, 2022

In the future, some suggestions:

  • Make a new branch when making a PR.
  • Make the title more descriptive (I manually fixed this for you).
  • It's better if the PR author is the one that squashes. This is a bit more advanced though.
  • Write "Fixes #698" in the PR description so that merging auto-closes the issue. GitHub has some magic words such as "Fixes" and "Closes".

@aaronfranke aaronfranke merged commit e6c19ff into godotengine:4.0-dev Mar 30, 2022
@aaronfranke
Copy link
Member

Thanks!

@voylin
Copy link
Contributor Author

voylin commented Mar 30, 2022

In the future, some suggestions:

  • Make a new branch when making a PR.
  • Make the title more descriptive (I manually fixed this for you).
  • It's better if the PR author is the one that squashes. This is a bit more advanced though.
  • Write "Fixes #698" in the PR description so that merging auto-closes the issue.

Thank you for the help and information. I didn't know what squashing means, but a quick google search later and I'm up to date.
I will take these things in mind for next time. ^^

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

Successfully merging this pull request may close these issues.

2 participants