diff options
author | Neil <nyamatongwe@gmail.com> | 2022-09-25 11:33:59 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2022-09-25 11:33:59 +1000 |
commit | ed7e87bfd2dfb8cbbab786b3742385de9d1e6a2a (patch) | |
tree | 276373c9ec18eeaadf6da8ac693bce8c54162379 /src/EditView.cxx | |
parent | 9a2d8d26c2b7c67bded00126f35c631c864ce9d6 (diff) | |
download | scintilla-mirror-ed7e87bfd2dfb8cbbab786b3742385de9d1e6a2a.tar.gz |
Draw lines more consistently in SC_PHASES_TWO and SC_PHASES_ONE modes by
clipping drawing to just the line rectangle.
Diffstat (limited to 'src/EditView.cxx')
-rw-r--r-- | src/EditView.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx index 100d3d18b..2290cf8a6 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -2354,6 +2354,11 @@ void EditView::DrawLine(Surface *surface, const EditModel &model, const ViewStyl return; // No further drawing } + const bool clipLine = !bufferedDraw && !LinesOverlap(); + if (clipLine) { + surface->SetClip(rcLine); + } + // See if something overrides the line background colour. const std::optional<ColourRGBA> background = vsDraw.Background(model.GetMark(line), model.caret.active, ll->containsCaret); @@ -2429,6 +2434,10 @@ void EditView::DrawLine(Surface *surface, const EditModel &model, const ViewStyl if (FlagSet(phase, DrawPhase::lineTranslucent)) { DrawTranslucentLineState(surface, model, vsDraw, ll, line, rcLine, subLine, Layer::OverText); } + + if (clipLine) { + surface->PopClip(); + } } static void DrawFoldLines(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, |