Skip to content

Commit 00029db

Browse files
committed
Merge pull request #72 from hemnstill/dev2master
Fix selection of last line when mouse is below control and TextFormattingMode.Display is enabled
2 parents 67d9c95 + 8e27ad6 commit 00029db

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)