Only apply fix when the right font is selected

This commit is contained in:
CommanderRedYT
2022-12-16 14:39:24 +01:00
parent f4d375b12e
commit 576299b9d9

View File

@@ -2261,9 +2261,16 @@ int16_t TFT_eSPI::height() const
int16_t TFT_eSPI::textWidth(std::string_view string, uint8_t font)
{
int32_t str_width = 1;
int32_t str_width = 0;
uint16_t uniCode = 0;
#ifdef CONFIG_TFT_IS_AUTOBAHN
if (font == 1 || (gfxFont != &din1451alt10pt8b && font == 4))
{
str_width = 1;
}
#endif
auto iter = std::begin(string);
#ifdef SMOOTH_FONT