Skip to content

Games/Minesweeper: Stabilize layout when flag count digits change - #27057

Open
mkjt2 wants to merge 1 commit into
SerenityOS:masterfrom
mkjt2:minesweeper-unjiggle
Open

mkjt2 wants to merge 1 commit into
SerenityOS:masterfrom
mkjt2:minesweeper-unjiggle

Conversation

@mkjt2

@mkjt2 mkjt2 commented Sep 21, 2026

Copy link
Copy Markdown

When number of digits used to express remaining flag count changes, the UI layout jiggles from auto width.

One can reproduce it at Beginner difficulty level, and using a single flag (taking flag count from 10 to 9).

Before the fix:
image
image

Instead we can determine the max display width required for a given initial mine count, and set the width to that.

I test played with the change and it seems to work in stabilizing the layout.

After the fix:
image

image

@mkjt2
mkjt2 force-pushed the minesweeper-unjiggle branch from 995e8ae to e932c9f Compare September 21, 2026 23:58
@mkjt2
mkjt2 marked this pull request as ready for review September 21, 2026 23:59
@github-actions github-actions Bot added the 馃憖 pr-needs-review PR needs review from a maintainer or community member label Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

馃憖 pr-needs-review PR needs review from a maintainer or community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant