1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-10-31 00:07:39 +02:00

fix length

This commit is contained in:
Laserlicht
2025-10-05 01:57:01 +02:00
parent f5d1657041
commit e6272fe477

View File

@@ -83,15 +83,10 @@ void CTextInputWithConfirm::textInputted(const std::string & enteredText)
if(!hasFocus())
return;
CTextInput::textInputted(enteredText);
std::string visibleText = getVisibleText();
std::string visibleText = getVisibleText() + enteredText;
const auto & font = ENGINE->renderHandler().loadFont(label->font);
while(limitToRect && font->getStringWidth(visibleText) > pos.w)
{
TextOperations::trimRightUnicode(currentText);
visibleText = getVisibleText();
}
if(!limitToRect || font->getStringWidth(visibleText) < pos.w)
CTextInput::textInputted(enteredText);
}
void CTextInputWithConfirm::confirm()