Dont render over the screen edge

This commit is contained in:
2023-01-16 21:59:51 +01:00
parent 8813a281f0
commit 4509c58ca5

View File

@ -679,6 +679,8 @@ int16_t FontRenderer::drawString(std::string_view string, int32_t poX, int32_t p
while (n < len) {
uint16_t uniCode = decodeUTF8((const uint8_t*)std::begin(string), &n, len - n);
sumX += drawChar(uniCode, poX+sumX, poY, color, bgcolor, font);
if (poX+sumX > m_tft.width())
break;
}
}