From 3d992ce75b9526d5fffd753ea30b7a0447af3c50 Mon Sep 17 00:00:00 2001 From: Benedikt Stebner Date: Fri, 4 Feb 2022 07:42:16 +0100 Subject: [PATCH] Fix selection when the mouse is moved underneath the bounding box --- src/Avalonia.Visuals/Media/TextFormatting/TextLayout.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Visuals/Media/TextFormatting/TextLayout.cs b/src/Avalonia.Visuals/Media/TextFormatting/TextLayout.cs index 20daaadec0..26abf4fc98 100644 --- a/src/Avalonia.Visuals/Media/TextFormatting/TextLayout.cs +++ b/src/Avalonia.Visuals/Media/TextFormatting/TextLayout.cs @@ -406,7 +406,7 @@ namespace Avalonia.Media.TextFormatting return new TextHitTestResult(); } - characterHit = currentLine.GetNextCaretCharacterHit(new CharacterHit(currentLine.TextRange.End)); + characterHit = currentLine.GetCharacterHitFromDistance(point.X); return GetHitTestResult(currentLine, characterHit, point); }