Added option for turn on/off smooth scroll

This commit is contained in:
2025-11-30 09:43:50 +01:00
parent 8b350bfb9e
commit 98b7711100
6 changed files with 42 additions and 5 deletions

View File

@ -238,6 +238,7 @@ void GameRenderer::renderPlayingState(
}
bool allowActivePieceRender = true;
const bool smoothScrollEnabled = Settings::instance().isSmoothScrollEnabled();
auto computeFallOffset = [&]() -> float {
if (game->isPaused()) {
@ -257,7 +258,7 @@ void GameRenderer::renderPlayingState(
return progress * finalBlockSize;
};
float activePieceOffset = (!game->isPaused()) ? computeFallOffset() : 0.0f;
float activePieceOffset = (!game->isPaused() && smoothScrollEnabled) ? computeFallOffset() : 0.0f;
if (activePieceOffset > 0.0f) {
const auto& boardRef = game->boardRef();
const Game::Piece& piece = game->current();