Compare commits

...

2 Commits

Author SHA1 Message Date
tovjemam
453d9dad7f Fix compiler warnings 2026-03-22 19:43:03 +01:00
tovjemam
757c817855 Align text to whole pixels if scale is 1 to make it pixel perfect and not retarded in some cases 2026-03-22 19:42:15 +01:00

View File

@ -87,7 +87,7 @@ glm::vec2 gui::Context::MeasureText(std::string_view text)
glm::vec2 cursor(0.0f);
while (cp = DecodeUTF8Codepoint(p, end))
while ((cp = DecodeUTF8Codepoint(p, end)))
{
if (cp == ' ')
{
@ -146,9 +146,12 @@ void gui::Context::DrawText(std::string_view text, const glm::vec2& pos, uint32_
glm::vec2 cursor = pos;
if (scale == 1.0f)
cursor = glm::floor(cursor);
uint32_t curr_color = color;
while (cp = DecodeUTF8Codepoint(p, end))
while ((cp = DecodeUTF8Codepoint(p, end)))
{
if (cp == ' ')
{