From a033ebb63f1b1bb4826bd23ec9405cfb1f53ae74 Mon Sep 17 00:00:00 2001 From: Benedikt Stebner Date: Wed, 29 May 2024 17:00:13 +0200 Subject: [PATCH] Fix glyph offsets --- src/Skia/Avalonia.Skia/TextShaperImpl.cs | 2 +- src/Windows/Avalonia.Direct2D1/Media/TextShaperImpl.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Skia/Avalonia.Skia/TextShaperImpl.cs b/src/Skia/Avalonia.Skia/TextShaperImpl.cs index 6744727c245..963edd604f4 100644 --- a/src/Skia/Avalonia.Skia/TextShaperImpl.cs +++ b/src/Skia/Avalonia.Skia/TextShaperImpl.cs @@ -142,7 +142,7 @@ private static Vector GetGlyphOffset(ReadOnlySpan glyphPositions, var offsetX = position.XOffset * textScale; - var offsetY = position.YOffset * textScale; + var offsetY = -position.YOffset * textScale; return new Vector(offsetX, offsetY); } diff --git a/src/Windows/Avalonia.Direct2D1/Media/TextShaperImpl.cs b/src/Windows/Avalonia.Direct2D1/Media/TextShaperImpl.cs index 630696e7603..2d0edb8f379 100644 --- a/src/Windows/Avalonia.Direct2D1/Media/TextShaperImpl.cs +++ b/src/Windows/Avalonia.Direct2D1/Media/TextShaperImpl.cs @@ -143,7 +143,7 @@ private static Vector GetGlyphOffset(ReadOnlySpan glyphPositions, var offsetX = position.XOffset * textScale; - var offsetY = position.YOffset * textScale; + var offsetY = -position.YOffset * textScale; return new Vector(offsetX, offsetY); }