smaller stage, half steps above 2x — bigger, still even

Trimming the stage alone does nothing, and that is worth writing down: the
scale is snapped, so at 3x the game is 1512 device pixels wide whether the
stage is 560 or 512. Shrinking the surround only pays when it crosses a step.
So both halves land together.

── the stage ──

560x400 down to 512x352, which is expert (504x342, measured) plus four pixels
a side. There is nothing left to give — intermediate is 342 tall too, so
anything shorter clips a board people actually play.

── half steps from 2x ──

Not a retreat from whole-number scaling. The unit that has to stay regular is
the CELL, not the pixel: this is a 16px grid, so at 3.5x a cell is exactly 56
screen pixels — as even as 3x or 4x — and only sub-cell pixels alternate
between three and four. Below 2x that alternation is a third of a pixel rather
than a seventh, so whole numbers still apply there. The case that started all
this, a fractional devicePixelRatio at nominal 1:1, put the CELL boundaries at
26.4px, which is a different thing entirely.

Together, on a 1800x1400 device-pixel panel: 3.0x becomes 3.5x, and the game
goes from 1512 to 1764 device pixels wide.

Known cost, and it is in the README: the Extras > Auto Options dialog is 328
wide and opens 25px right of the game, so it needs a 554-wide stage to fit
whole from beginner. It cannot be closed from the panel anyway — no window
manager, no title bar, no OK button — so that is the thing to fix before this
number is revisited.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Officer-Session: de3ed4e6-f88a-429c-94e6-a760336ba83b
This commit is contained in:
2026-08-23 22:24:57 +00:00
co-authored by Claude Opus 5
parent 105068170c
commit e4247cd760
3 changed files with 42 additions and 24 deletions
+11 -7
View File
@@ -54,14 +54,18 @@ export type SessionStatus = {
* so the size here decides which step it lands on, and the steps are far apart. In a 1866-device-pixel
* panel: 800 wide gives 2x, 560 wide gives 3x. Same panel, half again as much game.
*
* 560x400 is expert (504x342) plus a margin, which is what the three standard difficulties need. A
* CUSTOM board larger than this is clipped at the right and bottom edges rather than shrunk — `centre`
* clamps at zero so the menu bar stays reachable. That is the trade: the sizes people actually play are
* as large as they can be, and the one that is not is still playable. Widen these two numbers if that
* turns out to be the wrong way round.
* 512x352 is expert (504x342, measured) plus four pixels a side. There is no room left to give: expert
* and intermediate are both 342 tall, so anything shorter clips a board somebody actually plays.
*
* Two things get clipped at this size, and both are deliberate. A CUSTOM board larger than the stage
* loses its right and bottom edges — `centre` clamps at zero, so the menu bar stays reachable. And the
* Extras → Auto Options dialog is 328 wide and opens 25px right of the game window, which needs a stage
* 554 wide to fit whole when the board is beginner. That dialog cannot be closed from the panel anyway
* (no window manager, so no title bar, and it has no OK button) — see the README. Fix that first, then
* revisit this number.
*/
const SCREEN_W = 560;
const SCREEN_H = 400;
const SCREEN_W = 512;
const SCREEN_H = 352;
/**
* How often to check whether the board changed size.