diff options
-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, |