mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +00:00
Added an extra check in OptionListComponent to avoid potential crashes
This commit is contained in:
parent
ae779a42e6
commit
f7cc0f6ace
|
@ -343,9 +343,11 @@ private:
|
||||||
|
|
||||||
mText.setText(ss.str());
|
mText.setText(ss.str());
|
||||||
mText.setSize(0, mText.getSize().y);
|
mText.setSize(0, mText.getSize().y);
|
||||||
setSize(mText.getTextCache()->metrics.size.x + mRightArrow.getSize().x +
|
setSize(
|
||||||
Font::get(FONT_SIZE_MEDIUM)->getLetterHeight() * 0.68f,
|
(mText.getTextCache() == nullptr ? 0.0f : mText.getTextCache()->metrics.size.x) +
|
||||||
mText.getSize().y);
|
mRightArrow.getSize().x +
|
||||||
|
Font::get(FONT_SIZE_MEDIUM)->getLetterHeight() * 0.68f,
|
||||||
|
mText.getSize().y);
|
||||||
if (mParent)
|
if (mParent)
|
||||||
mParent->onSizeChanged();
|
mParent->onSizeChanged();
|
||||||
}
|
}
|
||||||
|
@ -363,8 +365,10 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
mText.setSize(0.0f, mText.getSize().y);
|
mText.setSize(0.0f, mText.getSize().y);
|
||||||
setSize(mText.getTextCache()->metrics.size.x + mLeftArrow.getSize().x +
|
setSize((mText.getTextCache() == nullptr ?
|
||||||
mRightArrow.getSize().x +
|
0.0f :
|
||||||
|
mText.getTextCache()->metrics.size.x) +
|
||||||
|
mLeftArrow.getSize().x + mRightArrow.getSize().x +
|
||||||
Font::get(FONT_SIZE_MEDIUM)->getLetterHeight() * 0.68f,
|
Font::get(FONT_SIZE_MEDIUM)->getLetterHeight() * 0.68f,
|
||||||
mText.getSize().y);
|
mText.getSize().y);
|
||||||
if (mParent)
|
if (mParent)
|
||||||
|
|
Loading…
Reference in a new issue