From 099d6b8aee4ae69eb585f13bfdd28813af481985 Mon Sep 17 00:00:00 2001 From: Paul Fertser Date: Sun, 21 Jun 2020 00:24:30 +0300 Subject: [PATCH] Fix scrollbar thumb position for long menus Advanced settings menu has 9 entries so the thumb ends up being one pixel high and on the 9th menu it ends up being closer to the middle of the screen rather than the end. This patch fixes it. --- workspace/TS100/Core/Src/gui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workspace/TS100/Core/Src/gui.cpp b/workspace/TS100/Core/Src/gui.cpp index 2fe91a24..2102233b 100644 --- a/workspace/TS100/Core/Src/gui.cpp +++ b/workspace/TS100/Core/Src/gui.cpp @@ -935,7 +935,7 @@ void gui_Menu(const menuitem *menu) { OLED::clearScreen(); menu[currentScreen].draw.func(); uint8_t indicatorHeight = OLED_HEIGHT / scrollContentSize; - uint8_t position = currentScreen * indicatorHeight; + uint8_t position = OLED_HEIGHT * currentScreen / scrollContentSize; OLED::drawScrollIndicator(position, indicatorHeight); lastOffset = -1; lcdRefresh = true;