From 319709337ce38ca746dbc375f141177d381d912a Mon Sep 17 00:00:00 2001 From: Benedikt Stebner Date: Mon, 5 Aug 2024 16:35:38 +0200 Subject: [PATCH] Make sure GlyphRunImpl.InkBounds are always at a positive location --- src/Skia/Avalonia.Skia/GlyphRunImpl.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Skia/Avalonia.Skia/GlyphRunImpl.cs b/src/Skia/Avalonia.Skia/GlyphRunImpl.cs index 732d1871360..205daf4c7b9 100644 --- a/src/Skia/Avalonia.Skia/GlyphRunImpl.cs +++ b/src/Skia/Avalonia.Skia/GlyphRunImpl.cs @@ -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.Shared.Return(glyphBounds); BaselineOrigin = baselineOrigin;