diff options
author | Neil <nyamatongwe@gmail.com> | 2022-10-19 11:55:55 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2022-10-19 11:55:55 +1100 |
commit | 19a781319ccc6c9de302182e141383ba73403030 (patch) | |
tree | c44cc0e810a1eb4f7fd501d6760f507fd23373aa /src | |
parent | 7f36ea2269dee71024d037c6ae32488f421f5fc0 (diff) | |
download | scintilla-mirror-19a781319ccc6c9de302182e141383ba73403030.tar.gz |
Draw background colour for EOL annotations with standard and boxed visuals.
Diffstat (limited to 'src')
-rw-r--r-- | src/EditView.cxx | 40 |
1 files changed, 25 insertions, 15 deletions
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; } } |