From 0a31b48c5ac0a706fb15a64d6c7ee1f49151cc0d Mon Sep 17 00:00:00 2001 From: Tectu Date: Wed, 20 Jun 2012 15:32:18 +0200 Subject: [PATCH] very dirty fix --- glcd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/glcd.c b/glcd.c index b00fa698..36064df3 100644 --- a/glcd.c +++ b/glcd.c @@ -73,6 +73,7 @@ static const struct GLCDDriverVMT vmt = { uint16_t lcd_width, lcd_height; uint16_t bgcolor = White, fgcolor = Black; uint16_t cx = 0, cy = 0; +uint16_t cursor_x = 0, cursor_y = 0; static uint8_t tpText = 0; const uint8_t* font; @@ -272,6 +273,7 @@ size_t lcdPutString(const char *str) { void lcdMoveCursor(uint16_t x, uint16_t y, uint16_t color, uint16_t bkcolor) { cx = x; + cursor_x = x; cy = y; bgcolor = bkcolor; fgcolor = color; @@ -317,8 +319,7 @@ uint16_t lcdMeasureString(const char *str) { } void lcdLineBreak() { - // x=0 seems too much on the edge. So I keep it at 3 - cx = 3; + cx = cursor_x; cy += lcdGetCurFontHeight(); }