aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.cxx
diff options
context:
space:
mode:
authorMarko Njezic <devnull@localhost>2011-06-07 23:47:13 +0200
committerMarko Njezic <devnull@localhost>2011-06-07 23:47:13 +0200
commit8bdb4e9f566a8aeb8b691c77ecabd25b61e617df (patch)
treee4d119406e0701f1d155adeaf9dec0b0c3bff5e8 /src/Editor.cxx
parent739d908d758a1ea88d4cc124c1d6c38750cbd4bf (diff)
downloadscintilla-mirror-8bdb4e9f566a8aeb8b691c77ecabd25b61e617df.tar.gz
Make auto scrolling word wrap aware. Bug #3312763.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r--src/Editor.cxx8
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);