aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2008-01-08 01:08:01 +0000
committernyamatongwe <unknown>2008-01-08 01:08:01 +0000
commita78b038300f9cdf02619bb867c56541e57a3dada (patch)
treea1568230983194fd43d6db1f71f0931a7eca770a
parentbd677e9d340f49c1b99d9dd8c0dccb52e84a8ff3 (diff)
downloadscintilla-mirror-a78b038300f9cdf02619bb867c56541e57a3dada.tar.gz
Fixes horizontal scroll when document is wide and scroll position does
not fit into 16 bits.
-rw-r--r--win32/ScintillaWin.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx
index 19c82671e..1ee30d444 100644
--- a/win32/ScintillaWin.cxx
+++ b/win32/ScintillaWin.cxx
@@ -1934,10 +1934,15 @@ void ScintillaWin::HorizontalScrollMessage(WPARAM wParam) {
xPos = scrollWidth;
break;
case SB_THUMBPOSITION:
- xPos = HiWord(wParam);
- break;
- case SB_THUMBTRACK:
- xPos = HiWord(wParam);
+ case SB_THUMBTRACK: {
+ // Do NOT use wParam, its 16 bit and not enough for very long lines. Its still possible to overflow the 32 bit but you have to try harder =]
+ SCROLLINFO si;
+ si.cbSize = sizeof(si);
+ si.fMask = SIF_TRACKPOS;
+ if (GetScrollInfo(SB_HORZ, &si)) {
+ xPos = si.nTrackPos;
+ }
+ }
break;
}
HorizontalScrollTo(xPos);