mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15: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.setSize(0, mText.getSize().y);
|
||||
setSize(mText.getTextCache()->metrics.size.x + mRightArrow.getSize().x +
|
||||
Font::get(FONT_SIZE_MEDIUM)->getLetterHeight() * 0.68f,
|
||||
mText.getSize().y);
|
||||
setSize(
|
||||
(mText.getTextCache() == nullptr ? 0.0f : mText.getTextCache()->metrics.size.x) +
|
||||
mRightArrow.getSize().x +
|
||||
Font::get(FONT_SIZE_MEDIUM)->getLetterHeight() * 0.68f,
|
||||
mText.getSize().y);
|
||||
if (mParent)
|
||||
mParent->onSizeChanged();
|
||||
}
|
||||
|
@ -363,8 +365,10 @@ private:
|
|||
}
|
||||
|
||||
mText.setSize(0.0f, mText.getSize().y);
|
||||
setSize(mText.getTextCache()->metrics.size.x + mLeftArrow.getSize().x +
|
||||
mRightArrow.getSize().x +
|
||||
setSize((mText.getTextCache() == nullptr ?
|
||||
0.0f :
|
||||
mText.getTextCache()->metrics.size.x) +
|
||||
mLeftArrow.getSize().x + mRightArrow.getSize().x +
|
||||
Font::get(FONT_SIZE_MEDIUM)->getLetterHeight() * 0.68f,
|
||||
mText.getSize().y);
|
||||
if (mParent)
|
||||
|
|
Loading…
Reference in a new issue