| 250 | } |
| 251 | |
| 252 | void MainScreen::scrollToCursor(size_t count) |
| 253 | { |
| 254 | const int totalRows = count == 0 ? 0 : (int)((count - 1) / GRID_COLS) + 1; |
| 255 | const int maxScroll = std::max(0, totalRows - GRID_FULL_ROWS); |
| 256 | const int row = count == 0 ? 0 : (int)(mCursor / GRID_COLS); |
| 257 | if (row < mScrollRow) { |
| 258 | mScrollRow = row; |
| 259 | } |
| 260 | else if (row > mScrollRow + GRID_FULL_ROWS - 1) { |
| 261 | mScrollRow = row - (GRID_FULL_ROWS - 1); |
| 262 | } |
| 263 | mScrollRow = std::clamp(mScrollRow, 0, maxScroll); |
| 264 | } |
| 265 | |
| 266 | void MainScreen::updateGridCursor(const InputState& input, size_t count) |
| 267 | { |
nothing calls this directly
no outgoing calls
no test coverage detected