Merge pull request #14011 from jeroenvermeulen/fix_touch_buttons_without_ufilesys

Fix for #14006: can't USE_TOUCH_BUTTONS without USE_UFILESYS
This commit is contained in:
Theo Arends 2021-12-12 11:29:08 +01:00 committed by GitHub
commit 63d8d5ff2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -1610,10 +1610,12 @@ void Adafruit_GFX_Button::drawButton(boolean inverted) {
text = _fillcolor;
}
#if defined USE_UFILESYS
if (_label[0]=='/') {
draw_picture(_label, _x1, _y1, _w, _h, outline, inverted);
_gfx->drawRect(_x1, _y1, _w, _h, text);
} else {
#endif
uint8_t r = min(_w, _h) / 4; // Corner radius
_gfx->fillRoundRect(_x1, _y1, _w, _h, r, fill);
_gfx->drawRoundRect(_x1, _y1, _w, _h, r, outline);
@ -1622,7 +1624,9 @@ void Adafruit_GFX_Button::drawButton(boolean inverted) {
_gfx->setTextColor(text);
_gfx->setTextSize(_textsize_x, _textsize_y);
_gfx->print(_label);
#if defined USE_UFILESYS
}
#endif
}
/**************************************************************************/