From 1afd4100b4a5a08ae591266bc743fc7c469f8f76 Mon Sep 17 00:00:00 2001 From: tovjemam Date: Sun, 22 Mar 2026 19:33:46 +0100 Subject: [PATCH] Make space size in text rendering a whole number to fix weird rasterization --- src/gui/context.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/context.cpp b/src/gui/context.cpp index 01e3694..502385a 100644 --- a/src/gui/context.cpp +++ b/src/gui/context.cpp @@ -83,7 +83,7 @@ glm::vec2 gui::Context::MeasureText(std::string_view text) uint32_t cp = 0; const float line_height = font_->GetLineHeight(); - float space_size = line_height * 0.3f; + float space_size = glm::floor(line_height * 0.3f); glm::vec2 cursor(0.0f); @@ -142,7 +142,7 @@ void gui::Context::DrawText(std::string_view text, const glm::vec2& pos, uint32_ uint32_t cp = 0; const float line_height = font_->GetLineHeight() * scale; - float space_size = line_height * 0.3f; + float space_size = glm::floor(line_height * 0.3f); glm::vec2 cursor = pos;