From d56ecd60b423a7024b38ed8f15567df75ba78eb3 Mon Sep 17 00:00:00 2001 From: Raphael Hunziker Date: Thu, 10 Sep 2026 22:36:30 +0200 Subject: [PATCH] osd: fix sidebar scale scroll direction The scrolling altitude and speed sidebars moved the wrong way. A rising value scrolled the scale upwards, so the numbers travelling towards the center marker got smaller as the value grew. No reference instrument behaves like that. The scale glyphs SYM_AH_DECORATION_MIN..SYM_AH_DECORATION_MAX draw their tick marks progressively lower inside the character cell, so the step count is now added to the symbol instead of subtracted. A rising value now scrolls the scale downwards and brings the higher numbers down towards the center marker, the way a primary flight display works. The existing wrap around keeps the symbol inside the font range for either sign, so only the direction changes. The trend arrows are left alone, they report whether the value is rising or falling and not which way the scale moves. Only the grid OSD path is affected, the pixel OSD draws its sidebars through the sidebar widget instead. Fixes #9195 --- src/main/io/osd_grid.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/io/osd_grid.c b/src/main/io/osd_grid.c index fae92d195b7..8464bbe8329 100644 --- a/src/main/io/osd_grid.c +++ b/src/main/io/osd_grid.c @@ -300,7 +300,11 @@ static uint16_t osdUpdateSidebar(osd_sidebar_scroll_e scroll, osd_sidebar_t *sid break; } if (offset) { - decoration -= steps % SYM_AH_DECORATION_COUNT; + // Higher symbol codes draw the tick marks lower inside the character cell, + // so adding the steps scrolls the scale down as the value goes up. This + // matches a primary flight display, where climbing or accelerating brings + // the higher numbers down towards the center marker. + decoration += steps % SYM_AH_DECORATION_COUNT; if (decoration > SYM_AH_DECORATION_MAX) { decoration -= SYM_AH_DECORATION_COUNT; } else if (decoration < SYM_AH_DECORATION_MIN) {