From 5f6bd48022e9d129afc48de1f21385d4bb8b405b Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 14 Oct 2022 18:12:23 +0200 Subject: [PATCH] One more try to fix a rounding issue in TextComponent. --- es-core/src/components/TextComponent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/es-core/src/components/TextComponent.cpp b/es-core/src/components/TextComponent.cpp index 56961e4b9..ea32207ff 100644 --- a/es-core/src/components/TextComponent.cpp +++ b/es-core/src/components/TextComponent.cpp @@ -184,7 +184,7 @@ void TextComponent::render(const glm::mat4& parentTrans) break; } case ALIGN_CENTER: { - yOff = std::round(getSize().y - textSize.y) / 2.0f; + yOff = std::round((getSize().y - textSize.y) / 2.0f); break; } default: { @@ -194,7 +194,7 @@ void TextComponent::render(const glm::mat4& parentTrans) } else { // If height is smaller than the font height, then always center vertically. - yOff = std::round(getSize().y - textSize.y) / 2.0f; + yOff = std::round((getSize().y - textSize.y) / 2.0f); } // Draw the overall textbox area. If we're inside a scrollable container then this