diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2021-01-10 11:14:02 +0100 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2021-01-10 16:51:25 +0100 |
commit | 3bb731c645d1bcde6ecf6ca23e44eb6655da8726 (patch) | |
tree | 20b0f7d09c12ff15d9526670b82a9ae9eccfab61 /Meter.c | |
parent | a076488809b2f4a05a1aa19d6599a9cfc9a97018 (diff) |
RichString_setAttrn: refactor to take a length instead of a stop index
Fixes: #459
Diffstat (limited to 'Meter.c')
-rw-r--r-- | Meter.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); } |