Skip to content

Commit

Permalink
clang
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanjshaffer committed Jan 13, 2024
1 parent 7e841e9 commit 63c4efe
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions Adafruit_GFX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 63c4efe

Please sign in to comment.