From b433e12a46f13a84cd7b0dffe7094917fbd15157 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Wed, 10 Jun 2020 15:22:50 +0200 Subject: [PATCH] Roller fixes --- radio/src/thirdparty/libopenui/src/roller.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/radio/src/thirdparty/libopenui/src/roller.h b/radio/src/thirdparty/libopenui/src/roller.h index 9f18cc3ed..77a897801 100644 --- a/radio/src/thirdparty/libopenui/src/roller.h +++ b/radio/src/thirdparty/libopenui/src/roller.h @@ -73,12 +73,13 @@ class Roller: public Choice { int index = (scrollPositionY - ROLLER_LINE_HEIGHT + 1) / ROLLER_LINE_HEIGHT; coord_t y = index * ROLLER_LINE_HEIGHT; coord_t yMax = scrollPositionY + 3 * ROLLER_LINE_HEIGHT; + while (index < 0) + index += valuesCount; while (y < yMax) { - auto displayedValue = getValueFromIndex((index + valuesCount) % valuesCount); + auto displayedValue = getValueFromIndex(index % valuesCount); auto fgColor = DISABLE_COLOR; - if (value == displayedValue) { fgColor = FOCUS_COLOR | FONT(STD); }