Fix Theme::drawTextBox() to calculate the correct textbox size

If we are only calculating the textbox size (Graphics* g=nullptr) we
don't need to use the View scroll information anyway.
This commit is contained in:
David Capello 2021-10-12 15:28:57 -03:00
parent 161264a78d
commit 9dbbcbd7ef

View File

@ -747,7 +747,7 @@ void Theme::drawSlices(Graphics* g, os::Surface* sheet,
void Theme::drawTextBox(Graphics* g, Widget* widget,
int* w, int* h, gfx::Color bg, gfx::Color fg)
{
View* view = View::getView(widget);
View* view = (g ? View::getView(widget): nullptr);
char* text = const_cast<char*>(widget->text().c_str());
char* beg, *end;
int x1, y1;