diff options
author | McLoo <unknown> | 2020-02-21 02:15:24 +0100 |
---|---|---|
committer | McLoo <unknown> | 2020-02-21 02:15:24 +0100 |
commit | 0a648064cf4d88f6252aa880a0832d39a5331148 (patch) | |
tree | bc3b116441696f866ba8803d58ed9dffefef8206 /src | |
parent | 1f90d600278536b7ff0aab128174a0f93915d433 (diff) | |
download | scintilla-mirror-0a648064cf4d88f6252aa880a0832d39a5331148.tar.gz |
Feature [feature-requests:497] Automatically scroll while dragging text.
Added automatic scrolling when text dragged near edge of window.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 9c4ad2d4f..8f80ef716 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -4261,6 +4261,20 @@ void Editor::SetDragPosition(SelectionPosition newPos) { posDrop = newPos; } if (!(posDrag == newPos)) { + const int oldCaretYPolicy = caretYPolicy; + const int oldCaretYSlop = caretYSlop; + const int oldCaretXPolicy = caretXPolicy; + const int oldCaretXSlop = caretXSlop; + caretYPolicy = CARET_SLOP | CARET_STRICT | CARET_EVEN; + caretYSlop = 2; + caretXPolicy = CARET_SLOP | CARET_STRICT | CARET_EVEN; + caretXSlop = 50; + MovedCaret(newPos, posDrag, true); + caretYPolicy = oldCaretYPolicy; + caretYSlop = oldCaretYSlop; + caretXPolicy = oldCaretXPolicy; + caretXSlop = oldCaretXSlop; + caret.on = true; FineTickerCancel(tickCaret); if ((caret.active) && (caret.period > 0) && (newPos.Position() < 0)) |