-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Improve button min. size calculation. #92009
Conversation
I trust that checking all these is necessary, but how expensive is it computationally? I'm worried about how the cost might scale for button heavy UIs, like the Godot editor. |
I'll check it later, but |
This looks like something that can be cached when theme/layout changes. |
Moved it to theme cache.
With default theme, it takes |
Works on my end, thanks. P.S. There's also a problem with icons shifting in "hover-pressed". I was hoping it could be a part of the same problem as text, but this one still occurs: Screen.Recording.mp4 |
Probably draw should use max. style size for alignment as well. |
Updated to also fix this by caching the largest margins as well. |
It works 🎉 |
Thanks! |
Fixes #91022
Changes button min. size calculation to take into account all stiles and use the largest possible margin.
_get_current_stylebox()
can't be used for the min. size calculation, since min. size is not recalculated on hover.