Browse Source

remove stupid scrolling

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

28
src/screen.cpp

@ -289,25 +289,17 @@ 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 } else { // don't scroll
if ( (u8g2_uint_t)titleStr_offset < (u8g2_uint_t)-width ) u8g2.drawUTF8((u8g2.getDisplayWidth()-width)/2, 54, titleStr);
titleStr_offset = 0; // start over again }
uint32_t buffFill = mp3.getBuffFill();
} else { // don't scroll if (buffFill > 0 && buffFill <= 100) {
u8g2.drawUTF8((u8g2.getDisplayWidth()-width)/2, 54, titleStr); u8g2.drawLine(10,60,10+buffFill,60);
} }
uint32_t buffFill = mp3.getBuffFill();
if (buffFill > 0 && buffFill <= 100) {
u8g2.drawLine(10,60,10+buffFill,60);
}
} }
u8g2.sendBuffer(); u8g2.sendBuffer();
// bme280.printValues(); // bme280.printValues();

Loading…
Cancel
Save