From 1c7ec4e53894fc0ec2b37b4a778d9f37a535008d Mon Sep 17 00:00:00 2001 From: Benedikt Stebner Date: Mon, 4 Apr 2022 11:00:58 +0200 Subject: [PATCH] Fix GetDistanceFromCharacterHit --- src/Avalonia.Visuals/Media/TextFormatting/TextLineImpl.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Visuals/Media/TextFormatting/TextLineImpl.cs b/src/Avalonia.Visuals/Media/TextFormatting/TextLineImpl.cs index c19f008835..30e3728d1f 100644 --- a/src/Avalonia.Visuals/Media/TextFormatting/TextLineImpl.cs +++ b/src/Avalonia.Visuals/Media/TextFormatting/TextLineImpl.cs @@ -241,7 +241,7 @@ namespace Avalonia.Media.TextFormatting } //Look for a hit in within the current run - if (characterIndex >= textRun.Text.Start && characterIndex <= textRun.Text.End) + if (characterIndex >= textRun.Text.Start && characterIndex <= textRun.Text.Start + textRun.Text.Length) { var distance = currentRun.GetDistanceFromCharacterHit(characterHit);