summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/drivers/lcd-recorder.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c
index 99887b5dfc..67ea343218 100644
--- a/firmware/drivers/lcd-recorder.c
+++ b/firmware/drivers/lcd-recorder.c
@@ -391,7 +391,7 @@ static void lcd_putsxyofs(int x, int y, int ofs, unsigned char *str)
391 391
392 while ((ch = *str++) != '\0' && x < LCD_WIDTH) 392 while ((ch = *str++) != '\0' && x < LCD_WIDTH)
393 { 393 {
394 int width; 394 int gwidth, width;
395 395
396 /* check input range */ 396 /* check input range */
397 if (ch < pf->firstchar || ch >= pf->firstchar+pf->size) 397 if (ch < pf->firstchar || ch >= pf->firstchar+pf->size)
@@ -403,8 +403,8 @@ static void lcd_putsxyofs(int x, int y, int ofs, unsigned char *str)
403 break; 403 break;
404 404
405 /* get proportional width and glyph bits */ 405 /* get proportional width and glyph bits */
406 width = pf->width ? pf->width[ch] : pf->maxwidth; 406 gwidth = pf->width ? pf->width[ch] : pf->maxwidth;
407 width = MIN (width, LCD_WIDTH - x); 407 width = MIN (gwidth, LCD_WIDTH - x);
408 408
409 if (ofs != 0) 409 if (ofs != 0)
410 { 410 {
@@ -418,11 +418,22 @@ static void lcd_putsxyofs(int x, int y, int ofs, unsigned char *str)
418 418
419 if (width > 0) 419 if (width > 0)
420 { 420 {
421 int rows = (pf->height + 7) / 8; 421 int i;
422 bitmap_t* bits = pf->bits + 422 bitmap_t* bits = pf->bits +
423 (pf->offset ? pf->offset[ch] : (pf->height * ch)); 423 (pf->offset ? pf->offset[ch] : (pf->height * ch));
424 lcd_bitmap (((unsigned char*) bits) + ofs*rows, x, y, 424
425 width, pf->height, true); 425 if (ofs != 0)
426 {
427 for (i = 0; i < pf->height; i += 8)
428 {
429 lcd_bitmap (((unsigned char*) bits) + ofs, x, y + i, width,
430 MIN(8, pf->height - i), true);
431 ((unsigned char *)bits) += gwidth;
432 }
433 }
434 else
435 lcd_bitmap ((unsigned char*) bits, x, y, gwidth,
436 pf->height, true);
426 x += width; 437 x += width;
427 } 438 }
428 ofs = 0; 439 ofs = 0;