From bbf88744cb9ccd11c9d66d0e9b3b101c056a23b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Wr=C3=B3bel?= Date: Sun, 7 Jun 2015 19:30:14 +0200 Subject: [PATCH] [AVR] Fix last column of last row of DBLSIZE text (off-by-one error) --- radio/src/gui/9X/lcd.cpp | 2 +- radio/src/tests/dblsize_bottom_right_128x64.png | Bin 0 -> 311 bytes radio/src/tests/dblsize_bottom_right_212x64.png | Bin 0 -> 335 bytes radio/src/tests/lcd.cpp | 7 +++++++ 4 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 radio/src/tests/dblsize_bottom_right_128x64.png create mode 100644 radio/src/tests/dblsize_bottom_right_212x64.png diff --git a/radio/src/gui/9X/lcd.cpp b/radio/src/gui/9X/lcd.cpp index 41654e39d..cfdb18dc0 100755 --- a/radio/src/gui/9X/lcd.cpp +++ b/radio/src/gui/9X/lcd.cpp @@ -1181,7 +1181,7 @@ void lcd_putcAtt(coord_t x, uint8_t y, const unsigned char c, LcdFlags flags) b1 = ~b1; b2 = ~b2; } - if(&p[LCD_W+1] < DISPLAY_END) { + if(p+LCD_W < DISPLAY_END) { ASSERT_IN_DISPLAY(p); ASSERT_IN_DISPLAY(p+LCD_W); LCD_BYTE_FILTER(p, 0, b1); diff --git a/radio/src/tests/dblsize_bottom_right_128x64.png b/radio/src/tests/dblsize_bottom_right_128x64.png new file mode 100644 index 0000000000000000000000000000000000000000..d77b7e4c8c8d4679676dc19bcab145cf390b60e6 GIT binary patch literal 311 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!2~2@x4h5*Qq09po*^6@9Je3(KLBz$3p^r= z85p=bL736}jJ}x0h0SJe)n3S@YAQv zdE@OfcV66iE&ijN=?F^)r+~16nuAZn3XjFXv?)E-!sIo|gGxdtf6_n%{C!;NP@eq9s3C@*Sc T(f-s}`$8RNJ z#OXQ4#f^uy-edUhU6XRe-HqNv-dDCCxxe?#ubDe@GOL=rq? literal 0 HcmV?d00001 diff --git a/radio/src/tests/lcd.cpp b/radio/src/tests/lcd.cpp index 60a8f00b0..e3cebfbf3 100644 --- a/radio/src/tests/lcd.cpp +++ b/radio/src/tests/lcd.cpp @@ -174,6 +174,13 @@ TEST(Lcd, Line_Wrap) EXPECT_TRUE(checkScreenshot("line_wrap")); } +TEST(Lcd, DblsizeBottomRight) +{ + lcd_clear(); + lcd_putsAtt(LCD_W-20, LCD_H-16, "TEST", DBLSIZE); + EXPECT_TRUE(checkScreenshot("dblsize_bottom_right")); +} + #if defined(CPUARM) TEST(Lcd, Smlsize_putsStrIdx) {