diff options
| author | Tectu <joel@unormal.org> | 2012-07-25 16:04:00 -0700 |
|---|---|---|
| committer | Tectu <joel@unormal.org> | 2012-07-25 16:04:00 -0700 |
| commit | 5112cf7b49f102a87d4bb7afaff5a430eee2778e (patch) | |
| tree | a4736e595eb27222b5c1cbcdbbc0c91350582d13 | |
| parent | 392129dfcd0cbd2bcf52e6fa4b44127140566f16 (diff) | |
| parent | 637d92d5d5725beb7b002bb205fa8531b5039401 (diff) | |
| download | uGFX-5112cf7b49f102a87d4bb7afaff5a430eee2778e.tar.gz uGFX-5112cf7b49f102a87d4bb7afaff5a430eee2778e.tar.bz2 uGFX-5112cf7b49f102a87d4bb7afaff5a430eee2778e.zip | |
Merge pull request #20 from trsaunders/master
console fix
| -rw-r--r-- | glcd/console.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/glcd/console.c b/glcd/console.c index 0aac398b..21c97fa3 100644 --- a/glcd/console.c +++ b/glcd/console.c @@ -87,7 +87,7 @@ msg_t lcdConsoleInit(GLCDConsole *console, uint16_t x0, uint16_t y0, uint16_t wi /* read font, get height */ console->fy = font[FONT_TABLE_HEIGHT_IDX]; - /* calculate the size of the console as an integer multiple of characters */ + /* calculate the size of the console as an integer multiple of characters height*/ console->sx = width; console->sy = (((int16_t)(height/console->fy))-1)*console->fy; @@ -101,7 +101,7 @@ msg_t lcdConsoleInit(GLCDConsole *console, uint16_t x0, uint16_t y0, uint16_t wi console->font = font; - lcdFillArea(x0, y0, width, height, console->bkcolor); + lcdFillArea(x0, y0, x0+width, y0+height, console->bkcolor); } msg_t lcdConsolePut(GLCDConsole *console, char c) { @@ -110,8 +110,9 @@ msg_t lcdConsolePut(GLCDConsole *console, char c) { if(c == '\n') { /* clear the text at the end of the line */ if(console->cx < console->sx) - lcdFillArea(console->cx, console->cy, console->sx, console->cy + console->fy, - console->bkcolor); + lcdFillArea(console->x0 + console->cx, console->y0 + console->cy, + console->x0 + console->sx, console->y0 + console->cy + console->fy, + console->bkcolor); console->cx = 0; console->cy += console->fy; } else if(c == '\r') { @@ -121,7 +122,8 @@ msg_t lcdConsolePut(GLCDConsole *console, char c) { width = lcdMeasureChar(c, console->font); if((console->cx + width) >= console->sx) { /* clear the text at the end of the line */ - lcdFillArea(console->cx, console->cy, console->cx + width, console->cy + console->fy, + lcdFillArea(console->x0 + console->cx, console->y0 + console->cy, + console->x0 + console->cx + width, console->y0 + console->cy + console->fy, console->bkcolor); console->cx = 0; console->cy += console->fy; |
