diff options
author | Neil <nyamatongwe@gmail.com> | 2021-03-19 15:04:38 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-03-19 15:04:38 +1100 |
commit | dd9ae27be2d1b983638337f24685e6458360dfa3 (patch) | |
tree | 3b26625721b6704669c5a6d58d8a1199ad195afe /src | |
parent | 4b553e8fce75afd0ad0df2e752edafe739db44dc (diff) | |
download | scintilla-mirror-dd9ae27be2d1b983638337f24685e6458360dfa3.tar.gz |
Implement PopClip to allow local clipping.
Diffstat (limited to 'src')
-rw-r--r-- | src/EditView.cxx | 7 | ||||
-rw-r--r-- | src/Editor.cxx | 5 | ||||
-rw-r--r-- | src/Platform.h | 1 |
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; |