Fix overhang calculation (#19013)

* - Adjusts the overhang calculation so it matches what WPF produces
- Fixes baseline alignment for inline controls

* Adjust OverhangTrailing
Add unit test

* Only run overhang unit test on Windows
This commit is contained in:
Benedikt Stebner
2025-08-19 10:56:11 +02:00
committed by GitHub
parent 4f666f0ba1
commit a4b9eb3aab
11 changed files with 143 additions and 69 deletions
@@ -327,7 +327,7 @@ namespace TextTestApp
protected Size TextLineSize => _textLineSize ??= TextLine is { } textLine ? new Size(textLine.WidthIncludingTrailingWhitespace, textLine.Height) : default;
private Size? _inkSize;
protected Size InkSize => _inkSize ??= TextLine is { } textLine ? new Size(textLine.OverhangLeading + textLine.WidthIncludingTrailingWhitespace + textLine.OverhangTrailing, textLine.Extent) : default;
protected Size InkSize => _inkSize ??= TextLine is { } textLine ? new Size(-textLine.OverhangLeading + textLine.WidthIncludingTrailingWhitespace - textLine.OverhangTrailing, textLine.Extent) : default;
public event EventHandler? TextLineChanged;