mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-29 19:55:37 +00:00
Fix crash when no fast-select font specified
This commit is contained in:
parent
40dc9abdf8
commit
a15031733b
|
@ -41,11 +41,14 @@ void GuiFastSelect::render()
|
||||||
|
|
||||||
mBox->render();
|
mBox->render();
|
||||||
|
|
||||||
mTheme->getFastSelectFont()->drawCenteredText(LETTERS.substr(mLetterID, 1), 0, (int)(sh * 0.5f - (mTheme->getFastSelectFont()->getHeight() * 0.5f)), mTextColor);
|
std::shared_ptr<Font> letterFont = mTheme->getFastSelectFont();
|
||||||
mTheme->getDescriptionFont()->drawCenteredText("Sort order:", 0, (int)(sh * 0.6f - (mTheme->getDescriptionFont()->getHeight() * 0.5f)), mTextColor);
|
std::shared_ptr<Font> subtextFont = mTheme->getDescriptionFont();
|
||||||
|
|
||||||
|
letterFont->drawCenteredText(LETTERS.substr(mLetterID, 1), 0, (int)(sh * 0.5f - (letterFont->getHeight() * 0.5f)), mTextColor);
|
||||||
|
subtextFont->drawCenteredText("Sort order:", 0, (int)(sh * 0.6f - (subtextFont->getHeight() * 0.5f)), mTextColor);
|
||||||
|
|
||||||
std::string sortString = "<- " + mParent->getSortState().description + " ->";
|
std::string sortString = "<- " + mParent->getSortState().description + " ->";
|
||||||
mTheme->getDescriptionFont()->drawCenteredText(sortString, 0, (int)(sh * 0.6f + (mTheme->getDescriptionFont()->getHeight() * 0.5f)), mTextColor);
|
subtextFont->drawCenteredText(sortString, 0, (int)(sh * 0.6f + (subtextFont->getHeight() * 0.5f)), mTextColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GuiFastSelect::input(InputConfig* config, Input input)
|
bool GuiFastSelect::input(InputConfig* config, Input input)
|
||||||
|
|
|
@ -53,7 +53,7 @@ std::shared_ptr<Font> ThemeComponent::getDescriptionFont()
|
||||||
|
|
||||||
std::shared_ptr<Font> ThemeComponent::getFastSelectFont()
|
std::shared_ptr<Font> ThemeComponent::getFastSelectFont()
|
||||||
{
|
{
|
||||||
if(mFastSelectFont == NULL)
|
if(mFastSelectFont)
|
||||||
return mFastSelectFont;
|
return mFastSelectFont;
|
||||||
else
|
else
|
||||||
return Font::get(*mWindow->getResourceManager(), Font::getDefaultPath(), FONT_SIZE_LARGE);
|
return Font::get(*mWindow->getResourceManager(), Font::getDefaultPath(), FONT_SIZE_LARGE);
|
||||||
|
|
Loading…
Reference in a new issue