aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2003-01-31 23:11:24 +0000
committernyamatongwe <devnull@localhost>2003-01-31 23:11:24 +0000
commit9e9e3c45aa3d52ecbae1c483bf2125957bac6038 (patch)
treed46be56b27c969dd406d74d47febaab4b010bc59 /src
parent726d3ae2f2ae0c79d5215202d97310e26d00f022 (diff)
downloadscintilla-mirror-9e9e3c45aa3d52ecbae1c483bf2125957bac6038.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;