Skip to content

Commit

Permalink
Merge pull request #93 from tapir2342/fix-spritefont-valign
Browse files Browse the repository at this point in the history
SpriteFont: Fix vertical text alignment
  • Loading branch information
NoelFB committed Jun 29, 2024
2 parents c9614d5 + 32b7b63 commit 7a94f53
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Framework/Graphics/SpriteFont.cs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ public void WrapText(ReadOnlySpan<char> text, float maxLineWidth, List<(int Star
if (lineWidth > 0 && lineWidth + nextWordWidth > maxLineWidth)
{
writeLinesTo.Add((start, i - start));
start = i;
start = i + 1;
lineWidth = 0;
}

Expand Down Expand Up @@ -413,9 +413,6 @@ public void RenderText(Batcher batch, ReadOnlySpan<char> text, Vector2 position,

public void RenderText(Batcher batch, ReadOnlySpan<char> text, Vector2 position, Vector2 justify, Color color)
{
// TODO:
// I feel like the vertical alignment is slightly off, but not sure how.

var at = position + new Vector2(0, Ascent);
var last = 0;

Expand Down

0 comments on commit 7a94f53

Please sign in to comment.