summaryrefslogtreecommitdiffstats
path: root/Meter.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-01-10 11:14:02 +0100
committerChristian Göttsche <cgzones@googlemail.com>2021-01-10 16:51:25 +0100
commit3bb731c645d1bcde6ecf6ca23e44eb6655da8726 (patch)
tree20b0f7d09c12ff15d9526670b82a9ae9eccfab61 /Meter.c
parenta076488809b2f4a05a1aa19d6599a9cfc9a97018 (diff)
RichString_setAttrn: refactor to take a length instead of a stop index
Fixes: #459
Diffstat (limited to 'Meter.c')
-rw-r--r--Meter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Meter.c b/Meter.c
index 714fef25..2fe949ef 100644
--- a/Meter.c
+++ b/Meter.c
@@ -254,13 +254,13 @@ static void BarMeterMode_draw(Meter* this, int x, int y, int w) {
offset = 0;
for (uint8_t i = 0; i < this->curItems; i++) {
int attr = this->curAttributes ? this->curAttributes[i] : Meter_attributes(this)[i];
- RichString_setAttrn(&bar, CRT_colors[attr], startPos + offset, startPos + offset + blockSizes[i] - 1);
+ RichString_setAttrn(&bar, CRT_colors[attr], startPos + offset, blockSizes[i]);
RichString_printoffnVal(bar, y, x + offset, startPos + offset, MINIMUM(blockSizes[i], w - offset));
offset += blockSizes[i];
offset = CLAMP(offset, 0, w);
}
if (offset < w) {
- RichString_setAttrn(&bar, CRT_colors[BAR_SHADOW], startPos + offset, startPos + w - 1);
+ RichString_setAttrn(&bar, CRT_colors[BAR_SHADOW], startPos + offset, w - offset);
RichString_printoffnVal(bar, y, x + offset, startPos + offset, w - offset);
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy