Roller fix

This commit is contained in:
Bertrand Songis
2020-06-02 22:47:24 +02:00
parent 924627cd1d
commit 7993f303da
+3 -2
View File
@@ -83,8 +83,9 @@ class Roller: public Choice {
fgColor = FOCUS_COLOR | FONT(STD);
}
if ((unsigned)displayedValue < values.size()) {
dc->drawText(width() / 2, y, values[displayedValue].c_str(), fgColor | CENTERED);
unsigned valueIndex = displayedValue - vmin;
if (valueIndex < values.size()) {
dc->drawText(width() / 2, y, values[valueIndex].c_str(), fgColor | CENTERED);
}
else {
dc->drawNumber(width() / 2, y, displayedValue, fgColor | CENTERED);