From a0fa2c31bda397d2b93345919946d662383b089a Mon Sep 17 00:00:00 2001 From: Bodmer Date: Mon, 18 Apr 2022 22:57:47 +0100 Subject: [PATCH] Fill smooth font background if padding is set. --- TFT_eSPI.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/TFT_eSPI.cpp b/TFT_eSPI.cpp index eea3edb..9ec4312 100644 --- a/TFT_eSPI.cpp +++ b/TFT_eSPI.cpp @@ -5009,10 +5009,15 @@ int16_t TFT_eSPI::drawString(const char *string, int32_t poX, int32_t poY, uint8 if(fontLoaded) { setCursor(poX, poY); + bool fillbg = _fillbg; + // If padding is requested then fill the text background + if (padX && !_fillbg) _fillbg = true; + while (n < len) { uint16_t uniCode = decodeUTF8((uint8_t*)string, &n, len - n); drawGlyph(uniCode); } + _fillbg = fillbg; // restore state sumX += cwidth; //fontFile.close(); }