Indentation and shadowed variable.

This commit is contained in:
Blaž Kristan 2024-10-07 16:50:51 +02:00
parent eb5ad232a0
commit be64930ebb
2 changed files with 27 additions and 27 deletions

View File

@ -652,9 +652,9 @@ void Segment::drawCharacter(unsigned char chr, int16_t x, int16_t y, uint8_t w,
case 60: bits = pgm_read_byte_near(&console_font_5x12[(chr * h) + i]); break; // 5x12 font case 60: bits = pgm_read_byte_near(&console_font_5x12[(chr * h) + i]); break; // 5x12 font
default: return; default: return;
} }
uint32_t col = ColorFromPaletteWLED(grad, (i+1)*255/h, 255, NOBLEND); uint32_t c = ColorFromPaletteWLED(grad, (i+1)*255/h, 255, NOBLEND);
// pre-scale color for all pixels // pre-scale color for all pixels
col = color_fade(col, _segBri); c = color_fade(c, _segBri);
_colorScaled = true; _colorScaled = true;
for (int j = 0; j<w; j++) { // character width for (int j = 0; j<w; j++) { // character width
int x0, y0; int x0, y0;
@ -667,7 +667,7 @@ void Segment::drawCharacter(unsigned char chr, int16_t x, int16_t y, uint8_t w,
} }
if (x0 < 0 || x0 >= (int)vWidth() || y0 < 0 || y0 >= (int)vHeight()) continue; // drawing off-screen if (x0 < 0 || x0 >= (int)vWidth() || y0 < 0 || y0 >= (int)vHeight()) continue; // drawing off-screen
if (((bits>>(j+(8-w))) & 0x01)) { // bit set if (((bits>>(j+(8-w))) & 0x01)) { // bit set
setPixelColorXY(x0, y0, col); setPixelColorXY(x0, y0, c);
} }
} }
_colorScaled = false; _colorScaled = false;