aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/EditView.cxx7
-rw-r--r--src/Editor.cxx5
-rw-r--r--src/Platform.h1
3 files changed, 12 insertions, 1 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx
index 16614de48..5d15abf12 100644
--- a/src/EditView.cxx
+++ b/src/EditView.cxx
@@ -2246,7 +2246,8 @@ void EditView::PaintText(Surface *surfaceWindow, const EditModel &model, PRectan
// Remove selection margin from drawing area so text will not be drawn
// on it in unbuffered mode.
- if (!bufferedDraw && vsDraw.marginInside) {
+ const bool clipping = !bufferedDraw && vsDraw.marginInside;
+ if (clipping) {
PRectangle rcClipText = rcTextArea;
rcClipText.left -= leftTextOverlap;
surfaceWindow->SetClip(rcClipText);
@@ -2394,6 +2395,10 @@ void EditView::PaintText(Surface *surfaceWindow, const EditModel &model, PRectan
}
}
}
+
+ if (clipping)
+ surfaceWindow->PopClip();
+
//Platform::DebugPrintf("start display %d, offset = %d\n", model.pdoc->Length(), model.xOffset);
#if defined(TIME_PAINTING)
Platform::DebugPrintf(
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 5877239f0..c0a0135e1 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -1806,6 +1806,8 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
NeedWrapping(pcs->DocFromDisplay(topLine));
}
}
+ if (!view.bufferedDraw)
+ surfaceWindow->PopClip();
return;
}
@@ -1818,6 +1820,9 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
}
}
+ if (!view.bufferedDraw)
+ surfaceWindow->PopClip();
+
NotifyPainted();
}
diff --git a/src/Platform.h b/src/Platform.h
index 382ae30ee..bdb6a161d 100644
--- a/src/Platform.h
+++ b/src/Platform.h
@@ -215,6 +215,7 @@ public:
virtual XYPOSITION AverageCharWidth(const Font *font_)=0;
virtual void SetClip(PRectangle rc)=0;
+ virtual void PopClip()=0;
virtual void FlushCachedState()=0;
virtual void SetUnicodeMode(bool unicodeMode_)=0;