Browse Source

Fix GetDistanceFromCharacterHit

pull/7746/head
Benedikt Stebner 4 years ago
parent
commit
1c7ec4e538
  1. 2
      src/Avalonia.Visuals/Media/TextFormatting/TextLineImpl.cs

2
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);

Loading…
Cancel
Save