Skip to content

Commit

Permalink
Make sure GlyphRunImpl.InkBounds are always at a positive location (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Gillibald authored Sep 12, 2024
1 parent c50e731 commit d72ed10
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Skia/Avalonia.Skia/GlyphRunImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ public GlyphRunImpl(IGlyphTypeface glyphTypeface, double fontRenderingEmSize,
currentX += advance;
}

if (runBounds.Left < 0)
{
runBounds = runBounds.Translate(new Vector(-runBounds.Left, 0));
}

ArrayPool<SKRect>.Shared.Return(glyphBounds);

BaselineOrigin = baselineOrigin;
Expand Down

0 comments on commit d72ed10

Please sign in to comment.