Skip to content

Commit

Permalink
fix: simplify yPosition calculation by removing descent adjustment (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
yuto-trd authored Nov 27, 2024
1 parent 8c7c1c9 commit 97aab46
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Beutl.Engine/Graphics/Shapes/TextBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@ private void DrawSplitted(ICanvas canvas, TextElements elements)
{
Size lineBounds = MeasureLine(line);
float ascent = MinAscent(line);
float descent = MinDescent(line);
float yPosition = prevBottom - ascent - descent;
float yPosition = prevBottom - ascent;

float prevRight = 0;
foreach (FormattedText item in line)
Expand All @@ -290,7 +289,6 @@ private void DrawSplitted(ICanvas canvas, TextElements elements)
}

prevBottom += lineBounds.Height;
yPosition = prevBottom - ascent - descent;
}
}

Expand Down

0 comments on commit 97aab46

Please sign in to comment.