mirror of
https://github.com/adafruit/Adafruit-GFX-Library.git
synced 2024-10-03 18:18:46 -04:00
Fixed rotation bug in drawBitmap()
This commit is contained in:
parent
37a860d308
commit
4c865e0f29
@ -334,9 +334,12 @@ void Adafruit_GFX::fillTriangle ( int16_t x0, int16_t y0,
|
||||
void Adafruit_GFX::drawBitmap(int16_t x, int16_t y,
|
||||
const uint8_t *bitmap, int16_t w, int16_t h,
|
||||
uint16_t color) {
|
||||
for (int16_t j=0; j<h; j++) {
|
||||
for (int16_t i=0; i<w; i++ ) {
|
||||
if (pgm_read_byte(bitmap + i + (j/8)*w) & _BV(j%8)) {
|
||||
|
||||
int16_t i, j, byteWidth = (w + 7) / 8;
|
||||
|
||||
for(j=0; j<h; j++) {
|
||||
for(i=0; i<w; i++ ) {
|
||||
if(pgm_read_byte(bitmap + j * byteWidth + i / 8) & _BV(i & 7)) {
|
||||
drawPixel(x+i, y+j, color);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user