Browse Source

remove stupid scrolling

main
Hendrik Langer 7 years ago
parent
commit
4154eb907b
  1. 12
      src/screen.cpp

12
src/screen.cpp

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

Loading…
Cancel
Save