diff options
-rw-r--r-- | src/Editor.cxx | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index d43c8e2ce..ee6836acd 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -6371,16 +6371,12 @@ void Editor::ButtonMove(Point pt) { // Autoscroll PRectangle rcClient = GetClientRectangle(); + int lineMove = DisplayFromPosition(movePos.Position()); if (pt.y > rcClient.bottom) { - int lineMove = cs.DisplayFromDoc(LineFromLocation(pt)); - if (lineMove < 0) { - lineMove = cs.DisplayFromDoc(pdoc->LinesTotal() - 1); - } ScrollTo(lineMove - LinesOnScreen() + 1); Redraw(); } else if (pt.y < rcClient.top) { - int lineMove = cs.DisplayFromDoc(LineFromLocation(pt)); - ScrollTo(lineMove - 1); + ScrollTo(lineMove); Redraw(); } EnsureCaretVisible(false, false, true); |