Skip to content

Commit 8e27ad6

Browse files
Reshetnikov_ASReshetnikov_AS
authored andcommitted
With TextFormattingMode.Display VisualLine bottom bound not recognized. As result mouse cursor changing and selection below control buggy.
1 parent 5279a77 commit 8e27ad6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ICSharpCode.AvalonEdit/Editing/SelectionMouseHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ int GetOffsetFromMousePosition(Point positionRelativeToTextView, out int visualC
531531
if (pos.Y > textView.ActualHeight)
532532
pos.Y = textView.ActualHeight;
533533
pos += textView.ScrollOffset;
534-
if (pos.Y > textView.DocumentHeight)
534+
if (pos.Y >= textView.DocumentHeight)
535535
pos.Y = textView.DocumentHeight - ExtensionMethods.Epsilon;
536536
VisualLine line = textView.GetVisualLineFromVisualTop(pos.Y);
537537
if (line != null) {
@@ -552,7 +552,7 @@ int GetOffsetFromMousePositionFirstTextLineOnly(Point positionRelativeToTextView
552552
if (pos.Y > textView.ActualHeight)
553553
pos.Y = textView.ActualHeight;
554554
pos += textView.ScrollOffset;
555-
if (pos.Y > textView.DocumentHeight)
555+
if (pos.Y >= textView.DocumentHeight)
556556
pos.Y = textView.DocumentHeight - ExtensionMethods.Epsilon;
557557
VisualLine line = textView.GetVisualLineFromVisualTop(pos.Y);
558558
if (line != null) {

0 commit comments

Comments
 (0)