From 18bbd97433c5ba8bc650605a7c4bb9f288833119 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Tue, 25 Oct 2022 20:34:58 +0200 Subject: [PATCH] Fixed an issue where the textlist selector would not get sized correctly. --- es-core/src/components/primary/TextListComponent.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/es-core/src/components/primary/TextListComponent.h b/es-core/src/components/primary/TextListComponent.h index 6cfebe848..f1013897d 100644 --- a/es-core/src/components/primary/TextListComponent.h +++ b/es-core/src/components/primary/TextListComponent.h @@ -489,11 +489,10 @@ template void TextListComponent::render(const glm::mat4& parentT // Currently selected item text might be looping. if (mCursor == i && mLoopOffset1 > 0) { drawTrans = glm::translate( - drawTrans, - glm::round(offset - glm::vec3 {static_cast(mLoopOffset1), 0.0f, 0.0f})); + drawTrans, offset - glm::vec3 {static_cast(mLoopOffset1), 0.0f, 0.0f}); } else { - drawTrans = glm::translate(drawTrans, glm::round(offset)); + drawTrans = glm::translate(drawTrans, offset); } // Needed to avoid flickering when returning to the start position. @@ -508,8 +507,7 @@ template void TextListComponent::render(const glm::mat4& parentT mLoopScroll = true; drawTrans = trans; drawTrans = glm::translate( - drawTrans, - glm::round(offset - glm::vec3 {static_cast(mLoopOffset2), 0.0f, 0.0f})); + drawTrans, offset - glm::vec3 {static_cast(mLoopOffset2), 0.0f, 0.0f}); mRenderer->setMatrix(drawTrans); font->renderTextCache(entry.data.textCache.get()); } @@ -567,7 +565,7 @@ void TextListComponent::applyTheme(const std::shared_ptr& theme, } setFont(Font::getFromTheme(elem, properties, mFont, 0.0f, mLegacyMode)); - const float selectorHeight {mFont->getSize() * mLineSpacing}; + const float selectorHeight {mFont->getHeight(mLineSpacing)}; setSelectorHeight(selectorHeight); if (properties & ALIGNMENT) {