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. --- src/EditView.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/EditView.cxx') 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