From 7cc5e9bbb4de6dde9c7d7d4159827bcfffc57c31 Mon Sep 17 00:00:00 2001 From: Benedikt Stebner Date: Fri, 17 Feb 2023 12:45:23 +0100 Subject: [PATCH] Fix a copy paste error so mouse movements are properly recognized if the width is smaller than the height. --- src/Avalonia.Controls/SelectableTextBlock.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Controls/SelectableTextBlock.cs b/src/Avalonia.Controls/SelectableTextBlock.cs index f8ce5d23f6b..6603e20a2a7 100644 --- a/src/Avalonia.Controls/SelectableTextBlock.cs +++ b/src/Avalonia.Controls/SelectableTextBlock.cs @@ -336,7 +336,7 @@ protected override void OnPointerMoved(PointerEventArgs e) point = new Point( MathUtilities.Clamp(point.X, 0, Math.Max(TextLayout.Bounds.Width, 0)), - MathUtilities.Clamp(point.Y, 0, Math.Max(TextLayout.Bounds.Width, 0))); + MathUtilities.Clamp(point.Y, 0, Math.Max(TextLayout.Bounds.Height, 0))); var hit = TextLayout.HitTestPoint(point); var textPosition = hit.TextPosition;