aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Indicator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Indicator.cxx')
-rw-r--r--src/Indicator.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Indicator.cxx b/src/Indicator.cxx
index e8702b17c..3551e7202 100644
--- a/src/Indicator.cxx
+++ b/src/Indicator.cxx
@@ -34,7 +34,7 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r
sacDraw = sacHover;
}
surface->PenColour(sacDraw.fore);
- int ymid = static_cast<int>(rc.bottom + rc.top) / 2;
+ const int ymid = static_cast<int>(rc.bottom + rc.top) / 2;
if (sacDraw.style == INDIC_SQUIGGLE) {
int x = static_cast<int>(rc.left+0.5);
const int xLast = static_cast<int>(rc.right+0.5);
@@ -52,9 +52,9 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r
surface->LineTo(x, static_cast<int>(rc.top) + y);
}
} else if (sacDraw.style == INDIC_SQUIGGLEPIXMAP) {
- PRectangle rcSquiggle = PixelGridAlign(rc);
+ const PRectangle rcSquiggle = PixelGridAlign(rc);
- int width = std::min(4000, static_cast<int>(rcSquiggle.Width()));
+ const int width = std::min(4000, static_cast<int>(rcSquiggle.Width()));
RGBAImage image(width, 3, 1.0, 0);
enum { alphaFull = 0xff, alphaSide = 0x2f, alphaSide2=0x5f };
for (int x = 0; x < width; x++) {
@@ -136,7 +136,7 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r
rcBox.top = rcLine.top + 1;
rcBox.bottom = rcLine.bottom;
// Cap width at 4000 to avoid large allocations when mistakes made
- int width = std::min(static_cast<int>(rcBox.Width()), 4000);
+ const int width = std::min(static_cast<int>(rcBox.Width()), 4000);
RGBAImage image(width, static_cast<int>(rcBox.Height()), 1.0, 0);
// Draw horizontal lines top and bottom
for (int x=0; x<width; x++) {
@@ -161,15 +161,15 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r
} else if (sacDraw.style == INDIC_DOTS) {
int x = static_cast<int>(rc.left);
while (x < static_cast<int>(rc.right)) {
- PRectangle rcDot = PRectangle::FromInts(x, ymid, x + 1, ymid + 1);
+ const PRectangle rcDot = PRectangle::FromInts(x, ymid, x + 1, ymid + 1);
surface->FillRectangle(rcDot, sacDraw.fore);
x += 2;
}
} else if (sacDraw.style == INDIC_COMPOSITIONTHICK) {
- PRectangle rcComposition(rc.left+1, rcLine.bottom-2, rc.right-1, rcLine.bottom);
+ const PRectangle rcComposition(rc.left+1, rcLine.bottom-2, rc.right-1, rcLine.bottom);
surface->FillRectangle(rcComposition, sacDraw.fore);
} else if (sacDraw.style == INDIC_COMPOSITIONTHIN) {
- PRectangle rcComposition(rc.left+1, rcLine.bottom-2, rc.right-1, rcLine.bottom-1);
+ const PRectangle rcComposition(rc.left+1, rcLine.bottom-2, rc.right-1, rcLine.bottom-1);
surface->FillRectangle(rcComposition, sacDraw.fore);
} else if (sacDraw.style == INDIC_POINT || sacDraw.style == INDIC_POINTCHARACTER) {
if (rcCharacter.Width() >= 0.1) {