-
-
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
Fix Control offset_*
property types
#98443
Fix Control offset_*
property types
#98443
Conversation
If you change a core API, you've also needed to add a change to https://github.com/godotengine/godot/blob/master/misc/extension_api_validation/4.3-stable.expected. |
487c0ea
to
e880d72
Compare
e880d72
to
80c2972
Compare
@Chaosus Thanks for the hint, updated! |
The documentation is wrong, those are supposed to be INTs. This is because this value is in pixel and sprites/controls that are not aligned to the grid would could look blurry. Changing this to float requires a proposal, but the documentation should be fixed for now. |
@groud hmm, why is the internal type and the arguments to |
Ah my bad, you are right. I had wrong memory about this. I am still a bit worried about exposing them as float though, I feel it might be a bit more annoying to deal with in the editor. But well, I don't mind the change, we'll see if people complain. |
@groud I could change the property hint to use 1px stepping. Then it shouldn't be annoying in the editor but you can set it to subpixel values in code. I just noticed this issue after some time of going crazy while trying to set an offset to some float value in a script and the engine always converting it to a whole number, while insisting on it being a float. Turned out the docs were not telling the truth here 😄 My usecase here is that I render a pixel game in a viewport with supersampling, so an offset of 0.25 game pixels likely end up being multiple screen pixels. |
Sounds good to me! |
80c2972
to
14e5889
Compare
@groud Changed the hint to use 1px stepping as well as allowing to enter values less than -4096 and greater than 4096 since these limits seemed arbitrary/obsolete to me. |
14e5889
to
08d8132
Compare
08d8132
to
1daa9a1
Compare
offset_*
property types
Thanks! |
The documentation and the setter/getter methods state that the
offset_*
properties ofControl
nodes are supposed to befloat
, the property declarations useVariant::INT
as property type though. This PR fixes that.