Do not display too many horintals on x7 screen

This fixes #7854
This commit is contained in:
3djc
2020-08-16 17:20:06 +02:00
parent d349bf6faa
commit 0f9c9a8725
+4
View File
@@ -67,7 +67,11 @@ void drawVerticalScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uin
void drawGauge(coord_t x, coord_t y, coord_t w, coord_t h, int32_t val, int32_t max)
{
#if !defined(PCBX7) // X7 LCD doesn't like too many horizontal lines
lcdDrawRect(x, y, w+1, h);
#else
h++;
#endif
lcdDrawFilledRect(x+1, y+1, w-1, 4, SOLID, ERASE);
coord_t len = limit((uint8_t)1, uint8_t((abs(val) * w/2 + max/2) / max), uint8_t(w/2));
coord_t x0 = (val>0) ? x+w/2 : x+1+w/2-len;