mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2025-08-11 00:24:44 +02:00
Fix #588
This commit is contained in:
@@ -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) {
|
||||||
|
Reference in New Issue
Block a user