added the WANT_ABSTRACTS define so the library works with text sizes greater than 1
Fork of Adafruit_GFX by
Diff: Adafruit_GFX.cpp
- Revision:
- 4:232e3d1d47bc
- Parent:
- 0:c3dcd4c4983a
--- a/Adafruit_GFX.cpp Wed Jan 23 02:43:38 2013 +0000
+++ b/Adafruit_GFX.cpp Sun Oct 12 04:42:13 2014 +0000
@@ -368,8 +368,9 @@
cursor_y += textsize*8;
cursor_x = 0;
}
- else if (c == '\r')
- cursor_x = 0;
+ else if (c == '\r') {
+ // cursor_x = 0;
+ }
else
{
drawChar(cursor_x, cursor_y, c, textcolor, textbgcolor, textsize);
@@ -383,6 +384,8 @@
return 1;
}
+
+
// draw a character
void Adafruit_GFX::drawChar(int16_t x, int16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size)
{
@@ -410,23 +413,27 @@
if (size == 1) // default size
drawPixel(x+i, y+j, color);
#ifdef WANT_ABSTRACTS
- else // big size
+ else { // big size
fillRect(x+(i*size), y+(j*size), size, size, color);
#endif
+ }
}
else if (bg != color)
{
if (size == 1) // default size
drawPixel(x+i, y+j, bg);
#ifdef WANT_ABSTRACTS
- else // big size
+ else {// big size
fillRect(x+i*size, y+j*size, size, size, bg);
-#endif
+#endif
+ }
}
line >>= 1;
}
}
}
+
+
void Adafruit_GFX::setRotation(uint8_t x)
{
x %= 4; // cant be higher than 3
