Prevent from writing the whole font when a char is missing (i.e. special chars)

This commit is contained in:
Bertrand Songis
2018-07-08 13:18:33 +02:00
parent 4880497db5
commit e8d8fc1806
+4 -2
View File
@@ -296,7 +296,8 @@ uint8_t BitmapBuffer::drawCharWithoutCache(coord_t x, coord_t y, const uint8_t *
{
coord_t offset = spec[index];
coord_t width = spec[index+1] - offset;
if (width > 0) drawBitmapPattern(x, y, font, flags, offset, width);
if (width > 0)
drawBitmapPattern(x, y, font, flags, offset, width);
return width;
}
@@ -304,7 +305,8 @@ uint8_t BitmapBuffer::drawCharWithCache(coord_t x, coord_t y, const BitmapBuffer
{
coord_t offset = spec[index];
coord_t width = spec[index+1] - offset;
drawBitmap(x, y, font, offset, 0, width);
if (width > 0)
drawBitmap(x, y, font, offset, 0, width);
return width;
}