diff -r 9df25b7cacc3 src/EditView.cxx --- a/src/EditView.cxx Mon Mar 02 19:27:58 2026 +1100 +++ b/src/EditView.cxx Wed Mar 04 15:46:33 2026 +1100 @@ -828,6 +828,13 @@ namespace { +constexpr PRectangle Larger(const PRectangle &rc, [[maybe_unused]] XYPOSITION delta) noexcept { + // Extend bottom-right to make larger by delta pixels + return PRectangle(rc.left, rc.top, rc.right + delta, rc.bottom + delta); + //return rc; +} + + constexpr ColourRGBA colourBug(0xff, 0, 0xfe, 0xf0); // Selection background colours are always defined, the value_or is to show if bug @@ -921,7 +928,7 @@ } void FillLineRemainder(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, - Sci::Line line, PRectangle rcLine, XYPOSITION left, int subLine) { + Sci::Line line, PRectangle rcLine, XYPOSITION left, int subLine, XYPOSITION seamOverDraw) { if (rcLine.Empty()) { return; } @@ -931,7 +938,7 @@ } const bool drawEOLSelection = eolInSelection && vsDraw.selection.eolFilled && (line < model.pdoc->LinesTotal() - 1); - const PRectangle rcArea = Clamp(rcLine, Edge::left, left); // Limit to right side of line from 'left' + const PRectangle rcArea = Larger(Clamp(rcLine, Edge::left, left), seamOverDraw); // Limit to right side of line from 'left' const ColourRGBA selectionBack = drawEOLSelection ? SelectionBackground(model, vsDraw, eolInSelection) : ColourRGBA{}; ColourRGBA base = vsDraw.styles[StyleDefault].back; @@ -1113,16 +1120,16 @@ } else if (const Style &styleLast = vsDraw.styles[ll->LastStyle()]; styleLast.eolFilled) { base = styleLast.back; } - surface->FillRectangleAligned(rcEOLIsSelected, Fill(base.Opaque())); + surface->FillRectangleAligned(Larger(rcEOLIsSelected, seamOverDraw), Fill(base.Opaque())); if (drawEOLSelection && (vsDraw.selection.layer != Layer::Base)) { - surface->FillRectangleAligned(rcEOLIsSelected, selectionBack); + surface->FillRectangleAligned(Larger(rcEOLIsSelected, seamOverDraw), selectionBack); } const bool drawEOLAnnotationStyledText = (vsDraw.eolAnnotationVisible != EOLAnnotationVisible::Hidden) && model.pdoc->EOLAnnotationStyledText(line).text; const bool fillRemainder = (!lastSubLine || (!model.GetFoldDisplayText(line) && !drawEOLAnnotationStyledText)); if (fillRemainder) { // Fill the remainder of the line - FillLineRemainder(surface, model, vsDraw, ll, line, rcLine, rcEOLIsSelected.right, subLine); + FillLineRemainder(surface, model, vsDraw, ll, line, rcLine, rcEOLIsSelected.right, subLine, seamOverDraw); } bool drawWrapMarkEnd = false; @@ -1198,7 +1205,7 @@ surface->FillRectangleAligned(rcSegment, Fill(textBack)); // Fill Remainder of the line - FillLineRemainder(surface, model, vsDraw, ll, line, rcLine, rcSegment.right, subLine); + FillLineRemainder(surface, model, vsDraw, ll, line, rcLine, rcSegment.right, subLine, seamOverDraw); } if (FlagSet(phase, DrawPhase::text)) { @@ -1286,8 +1293,8 @@ // it may be double drawing. This is to allow stadiums with // curved or angled ends to have the area outside in the correct // background colour. - surface->FillRectangleAligned(rcSegment, Fill(textBack)); - FillLineRemainder(surface, model, vsDraw, ll, line, rcLine, rcSegment.right, subLine); + surface->FillRectangleAligned(Larger(rcSegment, seamOverDraw), Fill(textBack)); + FillLineRemainder(surface, model, vsDraw, ll, line, rcLine, rcSegment.right, subLine, seamOverDraw); } const PRectangle rcText = TextPart(rcSegment, padding); @@ -1640,7 +1647,7 @@ void DrawBackground(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, int xStart, PRectangle rcLine, int subLine, Range lineRange, Sci::Position posLineStart, - ColourOptional background) { + ColourOptional background, XYPOSITION seamOverDraw) { const bool selBackDrawn = vsDraw.SelectionBackgroundDrawn(); bool inIndentation = subLine == 0; // Do not handle indentation except on first subline. @@ -1683,17 +1690,17 @@ // Blob display inIndentation = false; } - surface->FillRectangleAligned(rcSegment, Fill(textBack)); - } else { + } + surface->FillRectangleAligned(Larger(rcSegment, seamOverDraw), Fill(textBack)); + if (!ts.representation) { // Normal text display - surface->FillRectangleAligned(rcSegment, Fill(textBack)); if (vsDraw.viewWhitespace != WhiteSpace::Invisible) { for (int cpos = 0; cpos <= i - ts.start; cpos++) { if (ll->chars[cpos + ts.start] == ' ') { if (drawWhitespaceBackground && vsDraw.WhiteSpaceVisible(inIndentation)) { const PRectangle rcSpace = Intersection(rcLine, ll->SpanByte(cpos + ts.start).Offset(horizontalOffset)); - surface->FillRectangleAligned(rcSpace, + surface->FillRectangleAligned(Larger(rcSpace, seamOverDraw), vsDraw.ElementColourForced(Element::WhiteSpaceBack).Opaque()); } } else { @@ -2380,6 +2387,8 @@ surface->SetClip(rcLine); } + seamOverDraw = (!bufferedDraw && LinesOverlap()) ? 1.0 : 0.0; + // See if something overrides the line background colour. const ColourOptional background = vsDraw.Background(model.GetMark(line), model.caret.active, ll->containsCaret); @@ -2400,7 +2409,7 @@ if (FlagSet(phase, DrawPhase::back)) { DrawBackground(surface, model, vsDraw, ll, xStart, rcLine, subLine, lineRange, posLineStart, - background); + background, seamOverDraw); DrawFoldDisplayText(surface, model, vsDraw, ll, line, xStart, rcLine, subLine, subLineStart, DrawPhase::back); DrawEOLAnnotationText(surface, model, vsDraw, ll, line, xStart, rcLine, subLine, subLineStart, DrawPhase::back); // Remove drawBack to not draw again in DrawFoldDisplayText @@ -2514,6 +2523,7 @@ double durCopy = 0.0; ElapsedPeriod epWhole; #endif + surface->FillRectangleAligned(rcTextArea, Fill(ColourRGBA(0,0,0))); const bool bracesIgnoreStyle = ((vsDraw.braceHighlightIndicatorSet && (model.bracesMatchStyle == StyleBraceLight)) || (vsDraw.braceBadLightIndicatorSet && (model.bracesMatchStyle == StyleBraceBad))); diff -r 9df25b7cacc3 src/EditView.h --- a/src/EditView.h Mon Mar 02 19:27:58 2026 +1100 +++ b/src/EditView.h Wed Mar 04 15:46:33 2026 +1100 @@ -67,6 +67,8 @@ * overlap from one line to the next. */ Scintilla::PhasesDraw phasesDraw; + XYPOSITION seamOverDraw = 0; + int lineWidthMaxSeen; bool additionalCaretsBlink;