From 720002200bc7113a52073eab8289c830ae35b4a3 Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 28 Jul 2020 13:35:50 +1000 Subject: Backport: Fix position of marker symbols for SC_MARGIN_RTEXT which were being moved based on width of text. Backport of changeset 8462:1d48cfa70dcd. --- src/MarginView.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/MarginView.cxx b/src/MarginView.cxx index f0a3559f4..a742bdc4b 100644 --- a/src/MarginView.cxx +++ b/src/MarginView.cxx @@ -364,9 +364,11 @@ void MarginView::PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc, marks &= vs.ms[margin].mask; - PRectangle rcMarker = rcSelMargin; - rcMarker.top = static_cast(yposScreen); - rcMarker.bottom = static_cast(yposScreen + vs.lineHeight); + PRectangle rcMarker( + rcSelMargin.left, + static_cast(yposScreen), + rcSelMargin.right, + static_cast(yposScreen + vs.lineHeight)); if (vs.ms[margin].style == SC_MARGIN_NUMBER) { if (firstSubLine) { std::string sNumber; @@ -412,11 +414,12 @@ void MarginView::PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc, if (firstSubLine) { surface->FillRectangle(rcMarker, vs.styles[stMargin.StyleAt(0) + vs.marginStyleOffset].back); + PRectangle rcText = rcMarker; if (vs.ms[margin].style == SC_MARGIN_RTEXT) { const int width = WidestLineWidth(surface, vs, vs.marginStyleOffset, stMargin); - rcMarker.left = rcMarker.right - width - 3; + rcText.left = rcText.right - width - 3; } - DrawStyledText(surface, vs, vs.marginStyleOffset, rcMarker, + DrawStyledText(surface, vs, vs.marginStyleOffset, rcText, stMargin, 0, stMargin.length, drawAll); } else { // if we're displaying annotation lines, colour the margin to match the associated document line -- cgit v1.2.3