From a78b038300f9cdf02619bb867c56541e57a3dada Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 8 Jan 2008 01:08:01 +0000 Subject: Fixes horizontal scroll when document is wide and scroll position does not fit into 16 bits. --- win32/ScintillaWin.cxx | 13 +++++++++---- 1 file 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); -- cgit v1.2.3