diff --git a/include/Display_Graphic.h b/include/Display_Graphic.h index f216c38..02c70cf 100644 --- a/include/Display_Graphic.h +++ b/include/Display_Graphic.h @@ -22,7 +22,6 @@ private: uint8_t _mExtra; uint8_t _display_type = 0; - uint16_t _dispX = 0; uint16_t _dispY = 0; uint16_t _period = 1000; uint16_t _interval = 60000; // interval at which to power save (milliseconds) diff --git a/src/Display_Graphic.cpp b/src/Display_Graphic.cpp index 5a74bab..4c768c0 100644 --- a/src/Display_Graphic.cpp +++ b/src/Display_Graphic.cpp @@ -91,18 +91,19 @@ void DisplayGraphicClass::printText(const char* text, uint8_t line) break; } - // get the font height, to calculate the textheight + // get the font height, to calculate the textheight _dispY += (_display->getMaxCharHeight()) + 1; // calculate the starting position of the text + uint16_t dispX; if (line == 1) { - _dispX = 20 + ex; + dispX = 20 + ex; } else { - _dispX = 5 + ex; + dispX = 5 + ex; } // draw the Text, on the calculated pos - _display->drawStr(_dispX, _dispY, text); + _display->drawStr(dispX, _dispY, text); } void DisplayGraphicClass::loop() @@ -191,7 +192,6 @@ void DisplayGraphicClass::loop() } _display->sendBuffer(); - _dispX = 0; _dispY = 0; _mExtra++; _lastDisplayUpdate = millis();