|
@ -289,17 +289,9 @@ void MainScreen::draw() { |
|
|
u8g2_uint_t width = u8g2.getUTF8Width(titleStr); // calculate the pixel width of the text
|
|
|
u8g2_uint_t width = u8g2.getUTF8Width(titleStr); // calculate the pixel width of the text
|
|
|
|
|
|
|
|
|
if (width > u8g2.getDisplayWidth()) { |
|
|
if (width > u8g2.getDisplayWidth()) { |
|
|
u8g2_uint_t x = titleStr_offset; |
|
|
u8g2.drawUTF8(titleStr_offset, 54, titleStr); // draw the scolling text
|
|
|
do { // repeated drawing of the scrolling text...
|
|
|
|
|
|
u8g2.drawUTF8(x, 54, titleStr); // draw the scolling text
|
|
|
|
|
|
x += width; // add the pixel width of the scrolling text
|
|
|
|
|
|
} while( x < u8g2.getDisplayWidth() ); // draw again until the complete display is filled
|
|
|
|
|
|
|
|
|
|
|
|
// repeated drawing of the scrolling text...
|
|
|
titleStr_offset-=4; // scroll by one pixel
|
|
|
|
|
|
|
|
|
titleStr_offset-=2; // scroll by one pixel
|
|
|
|
|
|
if ( (u8g2_uint_t)titleStr_offset < (u8g2_uint_t)-width ) |
|
|
|
|
|
titleStr_offset = 0; // start over again
|
|
|
|
|
|
|
|
|
|
|
|
} else { // don't scroll
|
|
|
} else { // don't scroll
|
|
|
u8g2.drawUTF8((u8g2.getDisplayWidth()-width)/2, 54, titleStr); |
|
|
u8g2.drawUTF8((u8g2.getDisplayWidth()-width)/2, 54, titleStr); |
|
|