diff options
author | mrwastl <mrwastl@users.sourceforge.net> | 2010-05-15 17:29:10 +0200 |
---|---|---|
committer | mrwastl <mrwastl@users.sourceforge.net> | 2010-05-15 17:29:10 +0200 |
commit | 592389da2c5dce76e1f89df80cbee340ed277475 (patch) | |
tree | be0e4b2d0010991477bc75e42c584a5ebc2767d5 /glcdskin/object.c | |
parent | 81e18b8c8a7c851d87e795febacc294e39b9ad3a (diff) | |
download | graphlcd-base-592389da2c5dce76e1f89df80cbee340ed277475.tar.gz graphlcd-base-592389da2c5dce76e1f89df80cbee340ed277475.tar.bz2 |
glcdskin: improved scrolling of texts
Diffstat (limited to 'glcdskin/object.c')
-rw-r--r-- | glcdskin/object.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/glcdskin/object.c b/glcdskin/object.c index ce098f8..471233d 100644 --- a/glcdskin/object.c +++ b/glcdskin/object.c @@ -544,7 +544,14 @@ void cSkinObject::Render(GLCD::cBitmap * screen) } } - screen->DrawText(x, Pos().y, x + Size().w - 1, text, font, mColor, true, mScrollOffset); + + if (updateScroll) { + w += font->Width(" "); + std::string textdoubled = text + " " + text; + screen->DrawText(x, Pos().y, x + Size().w - 1, textdoubled, font, mColor, true, mScrollOffset); + } else { + screen->DrawText(x, Pos().y, x + Size().w - 1, text, font, mColor, true, mScrollOffset); + } if (updateScroll) { mScrollOffset += currScrollSpeed; |