Fix SD card reselect when scrolled (#13624)

- Change encoder position to 16-bit integer.
- Fix `SD_REPRINT_LAST_SELECTED_FILE` when the screen is scrolled.
This commit is contained in:
Scott Lahteine
2019-04-08 21:10:41 -05:00
committed by GitHub
parent 0e3c9e726d
commit 321a5e6580
11 changed files with 50 additions and 40 deletions

View File

@ -263,7 +263,7 @@ void InvadersGame::game_screen() {
if (ui.first_page) {
// Update Cannon Position
int32_t ep = (int32_t)ui.encoderPosition;
int16_t ep = int16_t(ui.encoderPosition);
ep = constrain(ep, 0, (LCD_PIXEL_WIDTH - (CANNON_W)) / (CANNON_VEL));
ui.encoderPosition = ep;