| 261 | } |
| 262 | |
| 263 | void MainScreen::scrollToCursor(size_t count) |
| 264 | { |
| 265 | const int totalRows = count == 0 ? 0 : (int)((count - 1) / GRID_COLS) + 1; |
| 266 | const int maxScroll = std::max(0, totalRows - GRID_FULL_ROWS); |
| 267 | const int row = count == 0 ? 0 : (int)(mCursor / GRID_COLS); |
| 268 | if (row < mScrollRow) { |
| 269 | mScrollRow = row; |
| 270 | } |
| 271 | else if (row > mScrollRow + GRID_FULL_ROWS - 1) { |
| 272 | mScrollRow = row - (GRID_FULL_ROWS - 1); |
| 273 | } |
| 274 | mScrollRow = std::clamp(mScrollRow, 0, maxScroll); |
| 275 | } |
| 276 | |
| 277 | void MainScreen::snapGridAnimation(void) |
| 278 | { |
nothing calls this directly
no outgoing calls
no test coverage detected