Fixed an issue where a GUI element size was incorrectly calculated.

This commit is contained in:
Leon Styhre 2021-02-01 00:08:29 +01:00
parent 392ca21adb
commit 2f3a2a6157

View file

@ -99,7 +99,7 @@ void GuiMenu::openUISettings()
if ((*it)->getName() != "retropie") { if ((*it)->getName() != "retropie") {
// If required, abbreviate the system name so it doesn't overlap the setting name. // If required, abbreviate the system name so it doesn't overlap the setting name.
std::string abbreviatedString = Font::get(FONT_SIZE_MEDIUM)-> std::string abbreviatedString = Font::get(FONT_SIZE_MEDIUM)->
getTextMaxWidth((*it)->getFullName(), Renderer::getScreenWidth() * 0.25f); getTextMaxWidth((*it)->getFullName(), mSize.x() * 0.47f);
float sizeDifference = Font::get(FONT_SIZE_MEDIUM)->sizeText((*it)->getFullName()).x() - float sizeDifference = Font::get(FONT_SIZE_MEDIUM)->sizeText((*it)->getFullName()).x() -
Font::get(FONT_SIZE_MEDIUM)->sizeText(abbreviatedString).x(); Font::get(FONT_SIZE_MEDIUM)->sizeText(abbreviatedString).x();
if (sizeDifference > 0) { if (sizeDifference > 0) {