From 63c4efe4a78503ba5a34f9f75bd3a8cf9ff8e53e Mon Sep 17 00:00:00 2001 From: nathan Date: Sat, 13 Jan 2024 09:18:48 -0500 Subject: [PATCH] clang --- Adafruit_GFX.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/Adafruit_GFX.cpp b/Adafruit_GFX.cpp index 3cc14852..ceefa7bb 100644 --- a/Adafruit_GFX.cpp +++ b/Adafruit_GFX.cpp @@ -1147,31 +1147,30 @@ void Adafruit_GFX::drawChar(int16_t x, int16_t y, unsigned char c, c++; // Handle 'classic' charset behavior startWrite(); - int8_t rp, rb;//Count sequential FG and BG pixels in column - for (int8_t i = 0; i < 5; i++, rp=0, rb=0) { // Char bitmap = 5 columns + int8_t rp, rb; // Count sequential FG and BG pixels in column + for (int8_t i = 0; i < 5; i++, rp = 0, rb = 0) { // Char bitmap = 5 columns uint8_t line = pgm_read_byte(&font[c * 5 + i]); for (int8_t j = 0; j < 8; j++, line >>= 1) { if (line & 1) { rp++; - if (!(1 & (line >> 1)) || j == 7) { //write sequential pixels with writeFillRect - if(rp == 1 && size_x == 1 && size_y == 1) { + if (!(1 & (line >> 1)) || + j == 7) { // write sequential pixels with writeFillRect + if (rp == 1 && size_x == 1 && size_y == 1) { writePixel(x + i, y + j, color); - } - else if(rp > 0) { - writeFillRect(x + i * size_x, y + (j - (rp -1)) * size_y, size_x, + } else if (rp > 0) { + writeFillRect(x + i * size_x, y + (j - (rp - 1)) * size_y, size_x, size_y * rp, color); } rp = 0; } - } - else if (bg != color) { + } else if (bg != color) { rb++; - if( 1 & (line >> 1) || j == 7) { //write sequential pixels with writeFillRect + if (1 & (line >> 1) || + j == 7) { // write sequential pixels with writeFillRect if (rb == 1 && size_x == 1 && size_y == 1) { writePixel(x + i, y + j, bg); - } - else if(rb > 0) { - writeFillRect(x + i * size_x, y + (j - (rb -1)) * size_y, size_x, + } else if (rb > 0) { + writeFillRect(x + i * size_x, y + (j - (rb - 1)) * size_y, size_x, size_y * rb, bg); } rb = 0;