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 /qt/ScintillaEditBase/PlatQt.cpp | |
parent | 4b553e8fce75afd0ad0df2e752edafe739db44dc (diff) | |
download | scintilla-mirror-dd9ae27be2d1b983638337f24685e6458360dfa3.tar.gz |
Implement PopClip to allow local clipping.
Diffstat (limited to 'qt/ScintillaEditBase/PlatQt.cpp')
-rw-r--r-- | qt/ScintillaEditBase/PlatQt.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp index 1b8f75c02..ce6f0313b 100644 --- a/qt/ScintillaEditBase/PlatQt.cpp +++ b/qt/ScintillaEditBase/PlatQt.cpp @@ -470,7 +470,7 @@ void SurfaceImpl::DrawTextClipped(PRectangle rc, { SetClip(rc); DrawTextNoClip(rc, font, ybase, text, fore, back); - GetPainter()->setClipping(false); + PopClip(); } void SurfaceImpl::DrawTextTransparent(PRectangle rc, @@ -489,9 +489,15 @@ void SurfaceImpl::DrawTextTransparent(PRectangle rc, void SurfaceImpl::SetClip(PRectangle rc) { + GetPainter()->save(); GetPainter()->setClipRect(QRectFFromPRect(rc)); } +void SurfaceImpl::PopClip() +{ + GetPainter()->restore(); +} + void SurfaceImpl::MeasureWidths(const Font *font, std::string_view text, XYPOSITION *positions) |