Quick fix for the stack overflow with DateTimeComponents in a ComponentGrid.

This commit is contained in:
Aloshi 2015-03-06 09:25:42 -06:00
parent 90bd22df14
commit da86b618c4

View file

@ -256,6 +256,8 @@ void DateTimeComponent::updateTextCache()
if(mAutoSize) if(mAutoSize)
{ {
mSize = mTextCache->metrics.size; mSize = mTextCache->metrics.size;
mAutoSize = false;
if(getParent()) if(getParent())
getParent()->onSizeChanged(); getParent()->onSizeChanged();
} }
@ -302,6 +304,7 @@ void DateTimeComponent::setFont(std::shared_ptr<Font> font)
void DateTimeComponent::onSizeChanged() void DateTimeComponent::onSizeChanged()
{ {
mAutoSize = false;
updateTextCache(); updateTextCache();
} }