diff options
author | Neil <nyamatongwe@gmail.com> | 2022-10-19 11:19:34 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2022-10-19 11:19:34 +1100 |
commit | 7f36ea2269dee71024d037c6ae32488f421f5fc0 (patch) | |
tree | c9b95a2bf3eb0eb9272c248cbc7e87ff7c1a2b47 /src/EditView.cxx | |
parent | 8d02433e8516bc1790895eb384947318d78f51a7 (diff) | |
download | scintilla-mirror-7f36ea2269dee71024d037c6ae32488f421f5fc0.tar.gz |
Use switch for EOL annotation shape drawing. Use const and PixelAlign for
rectangle. These changes should not affect behaviour, they are preparing for
next change set that will.
Diffstat (limited to 'src/EditView.cxx')
-rw-r--r-- | src/EditView.cxx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx index 681541418..b25d83618 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -1572,19 +1572,22 @@ 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) { - PRectangle rcBox = rcSegment; - rcBox.left = std::round(rcSegment.left); - rcBox.right = std::round(rcSegment.right); - if (vsDraw.eolAnnotationVisible == EOLAnnotationVisible::Boxed) { + const PRectangle rcBox = PixelAlign(rcSegment, 1); + + switch (vsDraw.eolAnnotationVisible) { + case EOLAnnotationVisible::Boxed: surface->RectangleFrame(rcBox, Stroke(textFore)); - } else { + break; + + default: if (phasesDraw == PhasesDraw::One) { // Draw an outline around the text - surface->Stadium(rcBox, FillStroke(ColourRGBA(textBack, 0), textFore, 1.0), ends); + 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, 1.0), ends); + surface->Stadium(rcBox, FillStroke(textBack, textFore), ends); } + break; } } } |