-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
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
Resizing SubViewportContainer with stretch enabled changes render resolution of child SubViewport #62041
Comments
@lapspider45 Please upload a minimal reproduction project to make this easier to troubleshoot. |
Done. |
In my opinion, In this way, the This is just my guess, maybe I'm wrong. |
I can confirm that this still happens with Beta 10 |
The workarounds also don't work anymore. The data of the subviewports size property properly changes, but the SVPs don't properly fill the viewport |
Still happens in Godot v4.1.1 stable. |
@djpeach it looks to me like you are reproducing the issue. Right now there is no sensible way to scale a SubViewport, since SubViewportContainer enforces a 1:1 pixel ratio in all cases |
I am actually reproducing that as well on 4.1.3
This indeed resize the actual Subviewport from origin resolution, but then requires unticking scale parameter to apply. EDIT: Setting the original resolution on Subviewport "size_2d_override", and target resolution on its "size" makes the viewport actually respect its resolution and scale to. Which works for me 🎉 |
Yes, it works. Or when |
Godot version
v4.0.alpha9.official.fc18891db
System information
Linux
Issue description
When resizing a SubViewportContainer with
stretch
enabled, thesize
of the child SubViewport is changed to the size of the container.What this does is to undo all the "stretching", since the resolution of the viewport is now the same as the displayed resolution. This is unexpected of a property named
stretch
, if this were intentional a more fitting name would beauto_resize
.This problem was present in Godot 3 as well, but it wasn't hard to write something like this to preserve the size of the viewport:
But in newer alpha versions Godot 4, this workaround stopped working consistently, especially inside nested containers. So this is what I resorted to:
This is very inelegant, and I don't see how SubViewportContainer messing with viewport sizes would be intended behavior in the first place.
Steps to reproduce
stretch
on SubViewportContainericon.png
or an image of your choice to the SubViewport, and set viewportsize
to the image dimensionsSTRETCH_SCALE
size
of the SubViewport to changeMinimal reproduction project
MRP_SubViewportContainer.zip
The text was updated successfully, but these errors were encountered: