Revert "Merge pull request #540 from justcallmekoko/master"
This reverts commit6dec790e8d, reversing changes made to8146ac3015.
This commit is contained in:
1 parent
6dec790e8d
commit
38a057762f
3 files changed
+7
-217
No files matched your search
+4
-18
@@ -3,10 +3,7 @@
|
||||
** Grabbed from Adafruit_GFX library and enhanced to handle any label font
|
||||
***************************************************************************************/
|
||||
TFT_eSPI_Button::TFT_eSPI_Button(void) {
|
||||
_gfx = 0;
|
||||
_xd = 0;
|
||||
_yd = 0;
|
||||
_textdatum = MC_DATUM;
|
||||
_gfx = 0;
|
||||
}
|
||||
|
||||
// Classic initButton() function: pass center & size
|
||||
@@ -38,15 +35,7 @@ void TFT_eSPI_Button::initButtonUL(
|
||||
strncpy(_label, label, 9);
|
||||
}
|
||||
|
||||
// Adjust text datum and x, y deltas
|
||||
void TFT_eSPI_Button::setLabelDatum(int16_t x_delta, int16_t y_delta, uint8_t datum)
|
||||
{
|
||||
_xd = x_delta;
|
||||
_yd = y_delta;
|
||||
_textdatum = datum;
|
||||
}
|
||||
|
||||
void TFT_eSPI_Button::drawButton(bool inverted, String long_name) {
|
||||
void TFT_eSPI_Button::drawButton(bool inverted) {
|
||||
uint16_t fill, outline, text;
|
||||
|
||||
if(!inverted) {
|
||||
@@ -67,11 +56,8 @@ void TFT_eSPI_Button::drawButton(bool inverted, String long_name) {
|
||||
_gfx->setTextSize(_textsize);
|
||||
|
||||
uint8_t tempdatum = _gfx->getTextDatum();
|
||||
_gfx->setTextDatum(_textdatum);
|
||||
if (long_name == "")
|
||||
_gfx->drawString(_label, _x1 + _xd, _y1 + (_h/2) + _yd);
|
||||
else
|
||||
_gfx->drawString(long_name, _x1 + _xd, _y1 + (_h/2) + _yd);
|
||||
_gfx->setTextDatum(MC_DATUM);
|
||||
_gfx->drawString(_label, _x1 + (_w/2), _y1 + (_h/2) -4);
|
||||
_gfx->setTextDatum(tempdatum);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user