forked from Bodmer/TFT_eSPI
Fix center aligned button text
This commit is contained in:
@@ -69,9 +69,9 @@ void TFT_eSPI_Button::drawButton(bool inverted, String long_name) {
|
||||
uint8_t tempdatum = _gfx->getTextDatum();
|
||||
_gfx->setTextDatum(_textdatum);
|
||||
if (long_name == "")
|
||||
_gfx->drawString(_label, _x1 + _xd, _y1 + (_h/2) + _yd);
|
||||
_gfx->drawString(_label, _x1 + (_w/2) + _xd, _y1 + (_h/2) - 4 + _yd);
|
||||
else
|
||||
_gfx->drawString(long_name, _x1 + _xd, _y1 + (_h/2) + _yd);
|
||||
_gfx->drawString(long_name, _x1 + (_w/2) + _xd, _y1 + (_h/2) - 4 + _yd);
|
||||
_gfx->setTextDatum(tempdatum);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user