From 5359bcb66f781fc1499734ec563f9a4f71945600 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Mon, 20 Oct 2003 10:29:41 +0000 Subject: Fixes to wrapping code. Priority wrap can wrap first line in document. Selection margin drawn after wrapping. Check modification for wrap performed after line heights scrolled because of line insertion or deletion. --- src/Editor.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Editor.cxx b/src/Editor.cxx index e07eed027..235821748 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -2523,14 +2523,12 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) { needUpdateUI = false; } - PaintSelMargin(surfaceWindow, rcArea); - // Call priority lines wrap on a window of lines which are likely // to rendered with the following paint (that is wrap the visible // lines first). int startLineToWrap = cs.DocFromDisplay(topLine) - 5; if (startLineToWrap < 0) - startLineToWrap = 0; + startLineToWrap = -1; if (WrapLines(false, startLineToWrap)) { // The wrapping process has changed the height of some lines so // abandon this paint for a complete repaint. @@ -2541,6 +2539,8 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) { } PLATFORM_ASSERT(pixmapSelPattern->Initialised()); + PaintSelMargin(surfaceWindow, rcArea); + PRectangle rcRightMargin = rcClient; rcRightMargin.left = rcRightMargin.right - vs.rightMarginWidth; if (rcArea.Intersects(rcRightMargin)) { @@ -3454,7 +3454,6 @@ void Editor::NotifyModified(Document*, DocModification mh, void *) { if (paintState == painting) { CheckForChangeOutsidePaint(Range(mh.position, mh.position + mh.length)); } - CheckModificationForWrap(mh); if (mh.modificationType & SC_MOD_CHANGESTYLE) { if (paintState == notPainting) { if (mh.position < pdoc->LineStart(topLine)) { @@ -3495,6 +3494,7 @@ void Editor::NotifyModified(Document*, DocModification mh, void *) { } else { cs.DeleteLines(lineOfPos, -mh.linesAdded); } + CheckModificationForWrap(mh); // Avoid scrolling of display if change before current display if (mh.position < posTopLine) { int newTop = Platform::Clamp(topLine + mh.linesAdded, 0, MaxScrollPos()); -- cgit v1.2.3