-
-
Notifications
You must be signed in to change notification settings - Fork 20.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
LineEdit cursor is sometimes invisible if 2D scaling is below the native resolution #58133
Comments
Related to #44253. This can likely be fixed by dividing the caret width by the control's scale if it's lower than 1.0, but this requires querying all the parent Controls for their own scale (which can be slow in complex scene trees).
Control scaling should only be used for animation purposes, as it breaks down in many situations (input handling, containers, …). Do not rely on Control scaling for multiple resolutions. Use Godot's built-in support for handling multiple resolutions instead, which supports lower-than-native scale factors and specifying a custom scale factor since Godot 3.4. |
In our project we don't explicitly scale down nodes, but our base resolution is set higher than some platforms we deploy to, resulting in them being scaled down by the engine. So perhaps the issue title/description could be improved. |
To my knowledge, this automatic scaling can't be easily detected on the node's size, so I'm not sure what could be done (other than defaulting the caret width to 2). |
Potential solution is allowing users to set the caret width in theme properties. |
This is already done in Feel free to look into backporting this to |
|
Godot version
3.4.2.stable
System information
Windows 10, GLES3
Issue description
All text editing controls use a cursor line width of 1 pixel in exported projects. This causes issues when using controls with different scales. This is a common use case when scaling down UI to fit smaller resolution screens.
Example:
This LineEdit has rect_scale=(0.9, 0.9)
At some cursor positions, it is visible:
However, in others, it is always invisible:
Steps to reproduce
See above
Minimal reproduction project
lineeditScaleBug.zip
The text was updated successfully, but these errors were encountered: