1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Refactoring & deduplication of infowindow code

This commit is contained in:
Ivan Savenko
2024-02-26 18:32:15 +02:00
parent 658cc14cd0
commit e6b339448f
10 changed files with 75 additions and 311 deletions

View File

@ -369,6 +369,17 @@ void CTextBox::sliderMoved(int to)
label->scrollTextTo(to);
}
void CTextBox::trimToFit()
{
if (slider)
return;
pos.w = label->textSize.x;
pos.h = label->textSize.y;
label->pos.w = label->textSize.x;
label->pos.h = label->textSize.y;
}
void CTextBox::resize(Point newSize)
{
pos.w = newSize.x;