Skip to content

Commit 5fb773a

Browse files
committed
removing ceil and making barType size_t
1 parent 546915b commit 5fb773a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Meter.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ static void BarMeterMode_draw(Meter* this, int x, int y, int w) {
138138
// First draw in the bar[] buffer...
139139
int offset = 0;
140140
const wchar_t* barChar = &bars[settings->barType][1];
141-
const uint8_t barLen = wcslen(barChar);
141+
const size_t barLen = wcslen(barChar);
142142
const uint8_t wsub = w * barLen;
143143

144144
for (uint8_t i = 0; i < this->curItems; i++) {
@@ -184,9 +184,9 @@ static void BarMeterMode_draw(Meter* this, int x, int y, int w) {
184184
offset = 0;
185185
for (uint8_t i = 0; i < this->curItems; i++) {
186186
int attr = this->curAttributes ? this->curAttributes[i] : Meter_attributes(this)[i];
187-
RichString_setAttrn(&bar, CRT_colors[attr], startPos + offset, ceil(blockSizes[i]));
188-
RichString_printoffnVal(bar, y, x + offset, startPos + offset, MINIMUM(ceil(blockSizes[i]), w - offset));
189-
offset += ceil((double)blockSizes[i]);
187+
RichString_setAttrn(&bar, CRT_colors[attr], startPos + offset, blockSizes[i]);
188+
RichString_printoffnVal(bar, y, x + offset, startPos + offset, MINIMUM(blockSizes[i], w - offset));
189+
offset += blockSizes[i];
190190
offset = CLAMP(offset, 0, w);
191191
}
192192
if (offset < w) {

0 commit comments

Comments
 (0)