-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
SubViewport size_2d_override
is limited by being of type Vector2i
#104601
Comments
Changing this isn't possible without breaking compatibility in pretty serious ways, and was rejected as a change in: Where a different solution was chosen, so this is unlikely to change in 4.x |
@AThousandShips could you elaborate on where this would break? I did see that issue before but to me it looks like it was chosen not to change the type of the property because it was possible to fix that issue without. This issue however is impossible to workaround because there is no way to set the stretch transform on a Viewport other than setting The only way I can currently see this breaking any existing code if someone is currently setting func _ready() -> void:
var some_size := Vector2(10.5, 10.5)
viewport.size_2d_override = some_size This example would now yield in a different result because of the missing implicit conversion to Vector2i. I get that this is a breaking change and that it is eventually not desirable to merge until a new major version, but I imagine you have some bigger breakage in mind that I have overlooked when you talk about breaking compat in pretty serious ways. 👀 |
This is not a bug to fix, it's at most a limitation to improve on, so breaking compatibility is a real concern. First of all this type is established as being integer valued, which informs use Further C# uses properties exclusively so I'm unsure how this kind of breakgage is handled there Further the actual viability of using non-integer scaling would need to be evaluated, just changing this type doesn't mean it will work properly, and I suspect there are other parts of the code that uses (or relies on) integer values, or at least don't support non-integers |
@AThousandShips Thank you! I didn't know C# doesn't use the compatibility getters/setters. The solution from the other PR is only a solution to that specific symptom in that issue though. The core issue still exists and has real usecases that aren't possible because of this.
After that logic this change should be no problem because
From what I can see, there are exactly two places that handle
So from what I gather, if set, |
(Please don't tag people who are already engaging in conversation, it's creating unnecessary noise for no reason) The change to the property type in C# would risk introducing bugs as it changes the type, i.e. breaking compatibility, it uses the getters/setters internally but you can't use them in C#
There's no such property |
Wrong word, my bad. I'm talking about |
Tested versions
System information
Godot v4.5.dev (6b5b84c) - Arch Linux #1 ZEN SMP PREEMPT_DYNAMIC Sun, 23 Mar 2025 17:17:17 +0000 on Wayland - X11 display driver, Multi-window, 2 monitors - Vulkan (Forward+) - dedicated Intel(R) Arc(tm) A770 Graphics (DG2) - Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz (16 threads)
Issue description
Currently, SubViewport
size_2d_override
is a property of typeVector2i
. Sincesize_2d_override
is solely used to calculate the viewport stretch transform, this unnecessarily limits the stretch transform to discrete values. I am currently working on a pixel art game with high resolution UI and this makes it impossible to correctly align the UI (which is rendered in a SubViewport with higher resolution) with the game world. The game world resolution can have fractional parts because one pixel in the game world are likely multiple pixels on the real screen.Screencast.From.2025-03-25.12-19-15.mp4
Steps to reproduce
size
(e.g. 500x500)Minimal reproduction project (MRP)
subviewport-size-2d-override-repro.zip
The text was updated successfully, but these errors were encountered: