Diagnostic screen proper alignment for narrow screen.

This commit is contained in:
Richard Li
2021-08-17 20:18:14 +08:00
parent 8fddcab05c
commit a1a5b23ff3
+7 -2
View File
@@ -40,8 +40,13 @@ class RadioAnalogsDiagsWindow: public Window {
void paint(BitmapBuffer * dc) override
{
for (uint8_t i = 0; i < NUM_STICKS + NUM_POTS + NUM_SLIDERS; i++) {
coord_t y = 1 + (i / 2) * FH;
uint8_t x = i & 1 ? LCD_W / 2 + 10 : 10;
#if LCD_W > LCD_H
coord_t y = 1 + (i / 2) * FH;
uint8_t x = i & 1 ? LCD_W / 2 + 10 : 10;
#else
coord_t y = 1 + i * FH;
uint8_t x = 10;
#endif
dc->drawNumber(x, y, i + 1, LEADING0 | LEFT, 2);
dc->drawText(x + 2 * 15 - 2, y, ":");
drawHexNumber(dc, x + 3 * 15 - 1, y, anaIn(i));