From 8d9ea838a40a2d36ec1a3c99faf5d31f21f14a00 Mon Sep 17 00:00:00 2001 From: zetaPRIME Date: Thu, 16 Mar 2017 14:32:37 -0400 Subject: [PATCH] font rendering: integer position snap for clarity --- libstarlight/source/starlight/gfx/FontBMF.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libstarlight/source/starlight/gfx/FontBMF.cpp b/libstarlight/source/starlight/gfx/FontBMF.cpp index c137dab..88fb399 100644 --- a/libstarlight/source/starlight/gfx/FontBMF.cpp +++ b/libstarlight/source/starlight/gfx/FontBMF.cpp @@ -32,8 +32,8 @@ void FontBMF::Print(Vector2 position, const std::string& text, float scale, Colo if (s.c == ' ' || s.c == '\n') return false; // skip spaces/newlines auto& ci = *s.cc; Vector2 pen = (Vector2(ci.offX, ci.offY) + Vector2(s.lineAcc - s.lineWidth * justification.x, font->lineHeight * ((float)s.lineNum - (float)s.numLines * justification.y))) * scale; - VRect crect(ci.imgX, ci.imgY, ci.width, ci.height); - qn->Add(VRect(pen, crect.size * scale), crect * uvScale); + VRect crect = VRect(ci.imgX, ci.imgY, ci.width, ci.height);//.IntSnap(); + qn->Add(VRect(pen.IntSnap(), crect.size * scale), crect * uvScale); return false; }); @@ -60,8 +60,8 @@ void FontBMF::Print(VRect rect, const std::string& text, float scale, Color colo if (s.c == ' ' || s.c == '\n') return false; // skip spaces/newlines auto& ci = *s.cc; Vector2 pen = (Vector2(ci.offX, ci.offY) + Vector2(s.lineAcc - s.lineWidth * justification.x, font->lineHeight * ((float)s.lineNum - (float)s.numLines * justification.y))) * scale; - VRect crect(ci.imgX, ci.imgY, ci.width, ci.height); - qn->Add(VRect(pen, crect.size * scale), crect * uvScale); + VRect crect = VRect(ci.imgX, ci.imgY, ci.width, ci.height);//.IntSnap(); + qn->Add(VRect(pen.IntSnap(), crect.size * scale), crect * uvScale); return false; }, rect.size.x);