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:
@ -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);
|
||||
|
Reference in New Issue
Block a user