mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	fix length
This commit is contained in:
		| @@ -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() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user