aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <unknown>2012-02-29 21:36:12 +1100
committernyamatongwe <unknown>2012-02-29 21:36:12 +1100
commit4c4e655420931ed2200a7d7e6b729d747f666870 (patch)
treee76dfb0ff26b25783138f9f590000ed3dc8c5c2f /src
parent2e771e5e226d98f3b1a1677abc6d7298f39d8c3f (diff)
downloadscintilla-mirror-4c4e655420931ed2200a7d7e6b729d747f666870.tar.gz
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.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx15
1 files changed, 10 insertions, 5 deletions
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);
}