mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-25 02:38:59 +00:00
2048: Fix off-by-1 when opening settings
When opening 2048's settings, it translates the target tile into a power of 2. Previously, it was done incorrectly, causing the resulting value to be off by one, and the number would increase every time one opens, saves and closes the settings. With this change, it now works as expected.
This commit is contained in:
parent
2b206b1854
commit
0fda98dfb3
Notes:
sideshowbarker
2024-07-19 17:11:09 +09:00
Author: https://github.com/dykatz
Commit: 0fda98dfb3
Pull-request: https://github.com/SerenityOS/serenity/pull/11781
Reviewed-by: https://github.com/bgianfo ✅
1 changed files with 1 additions and 1 deletions
|
@ -16,7 +16,7 @@
|
|||
GameSizeDialog::GameSizeDialog(GUI::Window* parent, size_t board_size, size_t target, bool evil_ai)
|
||||
: GUI::Dialog(parent)
|
||||
, m_board_size(board_size)
|
||||
, m_target_tile_power(AK::log2(target))
|
||||
, m_target_tile_power(AK::log2(target) - 1)
|
||||
, m_evil_ai(evil_ai)
|
||||
{
|
||||
set_rect({ 0, 0, 250, 150 });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue