From 592389da2c5dce76e1f89df80cbee340ed277475 Mon Sep 17 00:00:00 2001 From: mrwastl Date: Sat, 15 May 2010 17:29:10 +0200 Subject: glcdskin: improved scrolling of texts --- glcdskin/object.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3