Formspec: Measure length of PasswordChar in pwdfield[] to avoid scrolling early#16847
Formspec: Measure length of PasswordChar in pwdfield[] to avoid scrolling early#16847CrazyladMT wants to merge 2 commits intoluanti-org:masterfrom
pwdfield[] to avoid scrolling early#16847Conversation
| // get cursor area | ||
| u32 cursorWidth = font->getDimension(CursorChar.c_str()).Width; | ||
| core::stringw *txtLine = hasBrokenText ? &BrokenText[cursLine] : &Text; | ||
| core::stringw *txtLine = (hasBrokenText || PasswordBox) ? &BrokenText[cursLine] : &Text; |
There was a problem hiding this comment.
question, why in draw we have WordWrap and not there ?
There was a problem hiding this comment.
I'll have more time after this weekend to apply changes if needed, but in the meantime, it already checks for WordWrap here, right?
luanti/irr/src/CGUIEditBox.cpp
Line 1462 in 9e06189
This change was suggested by SmallJoker in his first review (#16847 (comment))
| const s32 hlineCount = ml ? getLineFromPos(realmend) - hlineStart + 1 : 1; | ||
| const s32 lineCount = ml ? BrokenText.size() : 1; | ||
|
|
||
| core::stringw *txtLine = (PasswordBox || WordWrap || MultiLine) ? &BrokenText[0] : &Text; |
There was a problem hiding this comment.
This needs updating inside the loop to render multi-line text correctly. See previous L817 and L818.
| if (PasswordBox && BrokenText.empty()) { | ||
| breakText(); | ||
| } |
There was a problem hiding this comment.
Why's the function call needed? inputString and processKey already break the text.
|
Seems there are some things that need to be fixed... I'm a little busy with other things at the moment, but I'll see what I can do soon... though some help would be much appreciated. |
Fixes #9368
Note
I used GPT-5 to assist with these changes.
To do
This PR is Ready for Review.
How to test