MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / scrollToCursor

Method scrollToCursor

switch/source/MainScreen.cpp:263–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263void 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
277void MainScreen::snapGridAnimation(void)
278{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected