From 19a781319ccc6c9de302182e141383ba73403030 Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 19 Oct 2022 11:55:55 +1100 Subject: Draw background colour for EOL annotations with standard and boxed visuals. --- src/EditView.cxx | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) (limited to 'src/EditView.cxx') diff --git a/src/EditView.cxx b/src/EditView.cxx index b25d83618..29569a00b 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -1571,24 +1571,34 @@ void EditView::DrawEOLAnnotationText(Surface *surface, const EditModel &model, c // Draw any box or stadium shape if (FlagSet(phase, DrawPhase::indicatorsBack)) { - if (vsDraw.eolAnnotationVisible >= EOLAnnotationVisible::Boxed) { - const PRectangle rcBox = PixelAlign(rcSegment, 1); + const PRectangle rcBox = PixelAlign(rcSegment, 1); - switch (vsDraw.eolAnnotationVisible) { - case EOLAnnotationVisible::Boxed: - surface->RectangleFrame(rcBox, Stroke(textFore)); - break; + switch (vsDraw.eolAnnotationVisible) { + case EOLAnnotationVisible::Standard: + if (phasesDraw != PhasesDraw::One) { + surface->FillRectangle(rcBox, textBack); + } + break; - default: - if (phasesDraw == PhasesDraw::One) { - // Draw an outline around the text - surface->Stadium(rcBox, FillStroke(ColourRGBA(textBack, 0), textFore), ends); - } else { - // Draw with a fill to fill the edges of the shape. - surface->Stadium(rcBox, FillStroke(textBack, textFore), ends); - } - break; + case EOLAnnotationVisible::Boxed: + if (phasesDraw == PhasesDraw::One) { + // Draw a rectangular outline around the text + surface->RectangleFrame(rcBox, textFore); + } else { + // Draw with a fill to fill the edges of the rectangle. + surface->RectangleDraw(rcBox, FillStroke(textBack, textFore)); + } + break; + + default: + if (phasesDraw == PhasesDraw::One) { + // Draw an outline around the text + surface->Stadium(rcBox, FillStroke(ColourRGBA(textBack, 0), textFore), ends); + } else { + // Draw with a fill to fill the edges of the shape. + surface->Stadium(rcBox, FillStroke(textBack, textFore), ends); } + break; } } -- cgit v1.2.3