mirror of
https://github.com/adafruit/Adafruit-GFX-Library.git
synced 2024-10-03 18:18:46 -04:00
made drawRect use fast lines
This commit is contained in:
parent
eb78fc6693
commit
7ef9c2e49e
@ -175,11 +175,9 @@ void Adafruit_GFX::drawLine(int16_t x0, int16_t y0,
|
|||||||
void Adafruit_GFX::drawRect(uint16_t x, uint16_t y,
|
void Adafruit_GFX::drawRect(uint16_t x, uint16_t y,
|
||||||
uint16_t w, uint16_t h,
|
uint16_t w, uint16_t h,
|
||||||
uint16_t color) {
|
uint16_t color) {
|
||||||
// stupidest version - update in subclasses if desired!
|
Serial.println('[]');
|
||||||
for (uint16_t i=x; i<x+w; i++) {
|
drawFastHLine(x, y, w, color);
|
||||||
drawPixel(i, y, color);
|
drawFastHLine(x, y+h-1, w, color);
|
||||||
drawPixel(i, y+h-1, color);
|
|
||||||
}
|
|
||||||
drawFastVLine(x, y, h, color);
|
drawFastVLine(x, y, h, color);
|
||||||
drawFastVLine(x+w-1, y, h, color);
|
drawFastVLine(x+w-1, y, h, color);
|
||||||
}
|
}
|
||||||
@ -348,6 +346,10 @@ void Adafruit_GFX::write(uint8_t c) {
|
|||||||
} else {
|
} else {
|
||||||
drawChar(cursor_x, cursor_y, c, textcolor, textbgcolor, textsize);
|
drawChar(cursor_x, cursor_y, c, textcolor, textbgcolor, textsize);
|
||||||
cursor_x += textsize*6;
|
cursor_x += textsize*6;
|
||||||
|
if (cursor_x > (width() - textsize*6)) {
|
||||||
|
cursor_y += textsize*8;
|
||||||
|
cursor_x = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#if ARDUINO >= 100
|
#if ARDUINO >= 100
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user