-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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 placeholder is not aligned correctly with center and right alignment. #18184
Comments
I can reproduce this on commit 59b8166. Pictured below are labels containing text and placeholder text, with left, center and right alignments: |
@akien-mga For me, it's only placeholders, with v3.0.2.stable.custom_build. |
Maybe Calinou meant can't instead of can |
On my screenshot, all fields have a placeholder defined but only 3 of them have text entered (so the placeholder displays on the other 3). |
Ok, I think I found the problem. It seems to be a problem updating the placeholder position and not calculating it. TL;DR at end. Try this steps to confirm all you get the same results as I do:
TL;DR: Will try to fix this as soon as possible, but feel free to send a PR. |
Editing the `Text` property through the editor causes a wrong placement of the placeholder, as it calls `LineEdit::clear_internal`, which was wrongly reseting the cached placeholder width. Fix godotengine#18184. (cherry picked from commit c17de1f)
Editing the `Text` property through the editor causes a wrong placement of the placeholder, as it calls `LineEdit::clear_internal`, which was wrongly reseting the cached placeholder width. Fix godotengine#18184.
Editing the `Text` property through the editor causes a wrong placement of the placeholder, as it calls `LineEdit::clear_internal`, which was wrongly reseting the cached placeholder width. Fix godotengine#18184. (cherry picked from commit c17de1f)
Still got this issue on 3.1.1 |
This is still a problem in Godot 3.2.2-beta4. |
Reporting same problem with 3.2.3 stable and 3.2.4 rc3. Seems like the cached_placeholder_width is not updated when the project is opened in the editor. If anyone needs a quick fix, setting the placeholder_text variable on ready in GDScript fixes the alignment. There might be other cases of the cached_width / cached_placeholder_width not updating cause I've also encountered regular text being aligned wrong in the editor. |
Currently still present in v3.3.3 C# Fix
GD Script Fix
|
v3.4 The alignment is screwing up in the editor too when changing the font of a LineEdit. I think this is the same issue as this thread's. The issue occurs in-game as well even though I'm not specifically loading a font, I'm using a custom Theme which has a custom font. In editor:
This will cause the alignment in the editor to be incorrect, requiring you to edit the text to re-correct the alignment. This solves my other in-game issue:
|
Fixed by #56837 for 3.5 (was fixed for 4.0 a while ago with a refactor). |
Bugsquad note: This issue has been confirmed several times already. No need to confirm it further.
Godot version:
Godot 3.0.2
OS/device including version:
Archlinux
Issue description:
Placeholder on LineEdits is misplaced when alignment is center or right. Shown on image below. Username is Left, Password is Center. When alignment is right, it doesn't show (it probably overflows and clips)
The text was updated successfully, but these errors were encountered: