Select previous item (dbl klick) on first element wraps around to last item

This commit is contained in:
borti4938 2016-08-19 14:47:43 +02:00
parent 2aa75f02b5
commit f1219e411c

View File

@ -861,9 +861,9 @@ unsigned char questionBox_OLED(const char* question, char answers[7][20], int nu
break; break;
} }
} }
else if (choice > 0) { else
choice--; choice = (choice > 0) ? choice - 1 : num_answers - 1;
}
// draw selection box // draw selection box
display.drawPixel(0, 8 * choice + 12, WHITE); display.drawPixel(0, 8 * choice + 12, WHITE);