From 9e9e3c45aa3d52ecbae1c483bf2125957bac6038 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Fri, 31 Jan 2003 23:11:24 +0000 Subject: 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. --- src/Editor.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') 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; -- cgit v1.2.3