Skip to content

Commit

Permalink
fix artifacts below text (yvt/openspades#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
siecvi committed Oct 27, 2024
1 parent 14fbb5c commit 1dc41ed
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Sources/Client/FTFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 1dc41ed

Please sign in to comment.