1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-23 00:28:08 +02:00

Do not attempt to resize text box to zero-width

This commit is contained in:
Ivan Savenko
2023-11-26 18:55:50 +02:00
parent 560a1231a6
commit 81a48f2d80
3 changed files with 9 additions and 1 deletions

View File

@ -376,6 +376,7 @@ void CTextBox::setText(const std::string & text)
{
// decrease width again if slider still used
label->pos.w = pos.w - 32;
assert(label->pos.w > 0);
label->setText(text);
slider->setAmount(label->textSize.y);
}
@ -383,6 +384,7 @@ void CTextBox::setText(const std::string & text)
{
// create slider and update widget
label->pos.w = pos.w - 32;
assert(label->pos.w > 0);
label->setText(text);
OBJECT_CONSTRUCTION_CUSTOM_CAPTURING(255 - DISPOSE);