From 1b585d29ad82606c327294837e27ffcd7a66172b Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 12 Feb 2023 11:31:37 +1100 Subject: Fix clipping of line end wrap symbol for SC_WRAPVISUALFLAGLOC_END_BY_TEXT. --- doc/ScintillaHistory.html | 3 +++ src/EditView.cxx | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 2d195d142..52bc2d610 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -590,6 +590,9 @@ Fix overlapping of text with line end wrap marker. Bug #2378. +
  • + Fix clipping of line end wrap symbol for SC_WRAPVISUALFLAGLOC_END_BY_TEXT. +
  • Release 5.3.3 diff --git a/src/EditView.cxx b/src/EditView.cxx index 3ba1ee4e5..f93303f6c 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -1121,14 +1121,15 @@ void EditView::DrawEOL(Surface *surface, const EditModel &model, const ViewStyle if (drawWrapMarkEnd) { PRectangle rcPlace = rcSegment; + const XYPOSITION maxLeft = rcPlace.right - vsDraw.aveCharWidth; if (FlagSet(vsDraw.wrap.visualFlagsLocation, WrapVisualLocation::EndByText)) { - rcPlace.left = xEol + xStart + virtualSpace; + rcPlace.left = std::min(xEol + xStart + virtualSpace, maxLeft); rcPlace.right = rcPlace.left + vsDraw.aveCharWidth; } else { // rcLine is clipped to text area rcPlace.right = rcLine.right; - rcPlace.left = rcPlace.right - vsDraw.aveCharWidth; + rcPlace.left = maxLeft; } if (!customDrawWrapMarker) { DrawWrapMarker(surface, rcPlace, true, vsDraw.WrapColour()); -- cgit v1.2.3