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 | |
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.
-rw-r--r-- | doc/ScintillaHistory.html | 6 | ||||
-rw-r--r-- | src/EditView.cxx | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 8f2a6206c..2224ca420 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -589,6 +589,12 @@ and was exposed by ScintillaDocument in the Qt implementation of ScintillaEdit. </li> <li> + Draw lines more consistently in SC_PHASES_TWO and SC_PHASES_ONE modes by + clipping drawing to just the line rectangle. + This stops drawing some extreme ascenders, descenders and portions of indicators which + may appear and then disappear depending on which lines were drawn. + </li> + <li> On Win32 implement horizontal scrolling mouse wheel. <a href="https://sourceforge.net/p/scintilla/feature-requests/1450/">Feature #1450</a>. </li> 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, |