aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <unknown>2003-01-31 23:11:24 +0000
committernyamatongwe <unknown>2003-01-31 23:11:24 +0000
commitf566263f31075e3d36782dd3f5901466b789f763 (patch)
treed46be56b27c969dd406d74d47febaab4b010bc59 /src
parent4e62df1da1150f0cfa156cd9c64b80fb43fb7d2c (diff)
downloadscintilla-mirror-f566263f31075e3d36782dd3f5901466b789f763.tar.gz
Patch from David Ascher for horizontal scrolling.
Change the scroll range when moving caret outside normal scroll range. Modify scroll bar when calling SetXOffset API to ensure synchronised.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index c20990a70..8ac091e8d 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -1224,6 +1224,14 @@ void Editor::EnsureCaretVisible(bool useMargin, bool vert, bool horiz) {
}
if (xOffset != xOffsetNew) {
xOffset = xOffsetNew;
+ if (xOffsetNew > 0) {
+ PRectangle rcText = GetTextRectangle();
+ if (horizontalScrollBarVisible == true &&
+ rcText.Width() + xOffset > scrollWidth) {
+ scrollWidth = xOffset + rcText.Width();
+ SetScrollBars();
+ }
+ }
SetHorizontalScrollPos();
Redraw();
}
@@ -4782,6 +4790,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_SETXOFFSET:
xOffset = wParam;
+ SetHorizontalScrollPos();
Redraw();
break;