From 1dc41ed2b4299927c11e9c46366b6b384f927129 Mon Sep 17 00:00:00 2001 From: siecvi <25997662+siecvi@users.noreply.github.com> Date: Sun, 27 Oct 2024 15:44:51 -0300 Subject: [PATCH] fix artifacts below text (https://github.com/yvt/openspades/issues/605) --- Sources/Client/FTFont.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Sources/Client/FTFont.cpp b/Sources/Client/FTFont.cpp index e662d76..7051d70 100644 --- a/Sources/Client/FTFont.cpp +++ b/Sources/Client/FTFont.cpp @@ -338,7 +338,12 @@ namespace spades { SPAssert(result); } - AABB2 bounds((*result).x, (*result).y, spbmp->GetWidth() - 1, spbmp->GetHeight() - 1); + AABB2 bounds( + (float)(*result).x, + (float)(*result).y, + (float)spbmp->GetWidth() - 1, + (float)spbmp->GetHeight() - 1 + ); Vector2 offs(g.face->glyph->bitmap_left, baselineY - g.face->glyph->bitmap_top); @@ -425,7 +430,12 @@ namespace spades { SPAssert(result); } - AABB2 bounds((*result).x, (*result).y, newbmp->GetWidth(), newbmp->GetHeight()); + AABB2 bounds( + (float)(*result).x, + (float)(*result).y, + (float)newbmp->GetWidth() - 1, + (float)newbmp->GetHeight() - 1 + ); Vector2 offs = (*g.image).offset - Vector2(1, 1) * (KernelSize * 0.5F);