diff --git a/radio/src/lcd_taranis.cpp b/radio/src/lcd_taranis.cpp index 01ab6337e..121698355 100755 --- a/radio/src/lcd_taranis.cpp +++ b/radio/src/lcd_taranis.cpp @@ -92,7 +92,7 @@ void lcd_vlineStip(xcoord_t x, int8_t y, int8_t h, uint8_t pat, LcdFlags att) if (x >= LCD_W) return; if (y >= LCD_H) return; if (h<0) { y+=h; h=-h; } - if (y<0) { h+=y; y=0; } + if (y<0) { h+=y; y=0; if (h<=0) return; } if (y+h > LCD_H) { h = LCD_H - y; } if (pat==DOTTED && !(y%2)) { diff --git a/radio/src/tests/lcd.cpp b/radio/src/tests/lcd.cpp index 8c6e80320..a2bbc5d7d 100644 --- a/radio/src/tests/lcd.cpp +++ b/radio/src/tests/lcd.cpp @@ -192,6 +192,16 @@ TEST(Lcd, vline) EXPECT_TRUE(checkScreenshot("vline")); } +#if defined(CPUARM) +TEST(Lcd, vline_x_lt0) +{ + lcd_clear(); + lcd_vline(50, -10, 12); + lcd_vline(100, -10, 1); + EXPECT_TRUE(checkScreenshot("vline_lt0")); +} +#endif + #if defined(CPUARM) TEST(Lcd, Smlsize) { diff --git a/radio/src/tests/vline_lt0_128x64.png b/radio/src/tests/vline_lt0_128x64.png new file mode 100644 index 000000000..90c3dc44c Binary files /dev/null and b/radio/src/tests/vline_lt0_128x64.png differ diff --git a/radio/src/tests/vline_lt0_212x64.png b/radio/src/tests/vline_lt0_212x64.png new file mode 100644 index 000000000..0bb79e914 Binary files /dev/null and b/radio/src/tests/vline_lt0_212x64.png differ