From 4c4e655420931ed2200a7d7e6b729d747f666870 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Wed, 29 Feb 2012 21:36:12 +1100 Subject: Bug #3493503. Clip drawing operations to the painting area when using unbuffered mode. This prevents parts of margin being drawn out of bounds. Don't set clipping region when buffered mode is used, as it is not necessary. From Marko Njezic. --- src/Editor.cxx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/Editor.cxx b/src/Editor.cxx index 2bab6571d..bb5813686 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -3532,6 +3532,9 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) { } PLATFORM_ASSERT(pixmapSelPattern->Initialised()); + if (!bufferedDraw) + surfaceWindow->SetClip(rcArea); + if (paintState != paintAbandoned) { PaintSelMargin(surfaceWindow, rcArea); @@ -3577,10 +3580,12 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) { // Remove selection margin from drawing area so text will not be drawn // on it in unbuffered mode. - PRectangle rcTextArea = rcClient; - rcTextArea.left = vs.fixedColumnWidth; - rcTextArea.right -= vs.rightMarginWidth; - surfaceWindow->SetClip(rcTextArea); + if (!bufferedDraw) { + PRectangle rcTextArea = rcClient; + rcTextArea.left = vs.fixedColumnWidth; + rcTextArea.right -= vs.rightMarginWidth; + surfaceWindow->SetClip(rcTextArea); + } // Loop on visible lines //double durLayout = 0.0; @@ -3665,7 +3670,7 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) { if (bufferedDraw) { Point from(vs.fixedColumnWidth, 0); PRectangle rcCopyArea(vs.fixedColumnWidth, yposScreen, - rcClient.right, yposScreen + vs.lineHeight); + rcClient.right - vs.rightMarginWidth, yposScreen + vs.lineHeight); surfaceWindow->Copy(rcCopyArea, from, *pixmapLine); } -- cgit v1.2.3