From e8d8fc18062d4a539081c90b64abe74e8251a13b Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Sun, 8 Jul 2018 13:18:33 +0200 Subject: [PATCH] Prevent from writing the whole font when a char is missing (i.e. special chars) --- radio/src/gui/480x272/bitmapbuffer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/radio/src/gui/480x272/bitmapbuffer.cpp b/radio/src/gui/480x272/bitmapbuffer.cpp index 204249e99..509730af4 100644 --- a/radio/src/gui/480x272/bitmapbuffer.cpp +++ b/radio/src/gui/480x272/bitmapbuffer.cpp @@ -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; }