diff options
| author | nyamatongwe <devnull@localhost> | 2002-01-09 12:01:59 +0000 |
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2002-01-09 12:01:59 +0000 |
| commit | 68d456d0d0b273805bc0bc5f7472ac63e172e0a7 (patch) | |
| tree | ffc195db7e99d1e83ae0f2f93ff3b55ec1f05c75 /win32/ScintillaWin.cxx | |
| parent | 55d0b272abea60454a825eef326e1c905081e3a8 (diff) | |
| download | scintilla-mirror-68d456d0d0b273805bc0bc5f7472ac63e172e0a7.tar.gz | |
Optimization that asks for the position of the scroll bar and does not set
it if it does not change.
Using scroll bar APIs that allow larger 32 bit values.
Diffstat (limited to 'win32/ScintillaWin.cxx')
| -rw-r--r-- | win32/ScintillaWin.cxx | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 1293d0737..ccf7402a1 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -847,12 +847,25 @@ void ScintillaWin::ScrollText(int linesToMove) { ::UpdateWindow(MainHWND()); } +// Change the scroll position but avoid repaint if changing to same value +static void ChangeScrollPos(HWND w, int barType, int pos) { + SCROLLINFO sci = { + sizeof(sci),0,0,0,0,0,0 + }; + sci.fMask = SIF_POS; + ::GetScrollInfo(w, barType, &sci); + if (sci.nPos != pos) { + sci.nPos = pos; + ::SetScrollInfo(w, barType, &sci, TRUE); + } +} + void ScintillaWin::SetVerticalScrollPos() { - ::SetScrollPos(MainHWND(), SB_VERT, topLine, TRUE); + ChangeScrollPos(MainHWND(), SB_VERT, topLine); } void ScintillaWin::SetHorizontalScrollPos() { - ::SetScrollPos(MainHWND(), SB_HORZ, xOffset, TRUE); + ChangeScrollPos(MainHWND(), SB_HORZ, xOffset); } bool ScintillaWin::ModifyScrollBars(int nMax, int nPage) { |
