Commit 5ab0a08d authored by Bodmer's avatar Bodmer

Fix #588

parent 5ff03cd2
...@@ -68,11 +68,16 @@ void TFT_eSPI_Button::drawButton(bool inverted, String long_name) { ...@@ -68,11 +68,16 @@ void TFT_eSPI_Button::drawButton(bool inverted, String long_name) {
uint8_t tempdatum = _gfx->getTextDatum(); uint8_t tempdatum = _gfx->getTextDatum();
_gfx->setTextDatum(_textdatum); _gfx->setTextDatum(_textdatum);
uint16_t tempPadding = _gfx->padX;
_gfx->setTextPadding(0);
if (long_name == "") if (long_name == "")
_gfx->drawString(_label, _x1 + (_w/2) + _xd, _y1 + (_h/2) - 4 + _yd); _gfx->drawString(_label, _x1 + (_w/2) + _xd, _y1 + (_h/2) - 4 + _yd);
else else
_gfx->drawString(long_name, _x1 + (_w/2) + _xd, _y1 + (_h/2) - 4 + _yd); _gfx->drawString(long_name, _x1 + (_w/2) + _xd, _y1 + (_h/2) - 4 + _yd);
_gfx->setTextDatum(tempdatum); _gfx->setTextDatum(tempdatum);
_gfx->setTextPadding(tempPadding);
} }
bool TFT_eSPI_Button::contains(int16_t x, int16_t y) { bool TFT_eSPI_Button::contains(int16_t x, int16_t y) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment