Spiel-Link: Zoom „Fit“ neben „Auto“ #279

Closed
opened 2026-09-29 18:26:31 +02:00 by meleki · 2 comments
Owner

Aus #266 (Entscheidung 8: „Not in this step: … zoom modes other than Auto“, dazu im Abschnitt Page: „Zoom: Auto only, i.e. the largest zoom step that fits entirely, no fit.“).

Befund

  • Die Spielseite zeichnet fest mit 'auto' (src/player/GameScreen.ts:92), also mit dem größten ganzen Zoomschritt, bei dem die Kamera ganz ins Fenster passt. Seit #266 sind das die Stufen 25, 50, 100, 200, 300, 400, 500 und 600 %.
  • Liegt das Fenster knapp unter der nächsten Stufe, bleibt viel Rand. Für ein Spiel ohne Pixel-Art wäre Fit oft besser: Es füllt das Fenster, auch mit krummen Faktoren.
  • Das Projekt speichert seit #226 den Maßstab des Game-Tabs (project.gameScale). Der Spiel-Link liest ihn nicht.

Zu bauen (Vorschlag)

  • Project settings bekommt Game link zoom: Auto (Standard, wie heute) oder Fit.
  • Die Spielseite nimmt diesen Wert. Feste Stufen wie 100 % gibt es dort nicht, weil die Fenstergröße der Spieler unbekannt ist.
  • Tests: Unit für den Faktor bei Fit, e2e 60 mit einem Projekt auf Fit.

Offen (mit Vorschlag)

  1. Eigene Einstellung oder gameScale mitbenutzen? Vorschlag: eine eigene. gameScale ist der Arbeitsmaßstab im Editor (Standard 100 %) und ändert sich beim Arbeiten ständig.
  2. Soll der Spieler selbst umschalten können, etwa mit einem Knopf neben dem Vollbild? Vorschlag: nein.
Aus #266 (Entscheidung 8: „Not in this step: … zoom modes other than Auto“, dazu im Abschnitt *Page*: „Zoom: **Auto** only, i.e. the largest zoom step that fits entirely, no fit.“). ## Befund - Die Spielseite zeichnet fest mit `'auto'` (`src/player/GameScreen.ts:92`), also mit dem größten ganzen Zoomschritt, bei dem die Kamera ganz ins Fenster passt. Seit #266 sind das die Stufen 25, 50, 100, 200, 300, 400, 500 und 600 %. - Liegt das Fenster knapp unter der nächsten Stufe, bleibt viel Rand. Für ein Spiel ohne Pixel-Art wäre *Fit* oft besser: Es füllt das Fenster, auch mit krummen Faktoren. - Das Projekt speichert seit #226 den Maßstab des Game-Tabs (`project.gameScale`). Der Spiel-Link liest ihn nicht. ## Zu bauen (Vorschlag) - Project settings bekommt **Game link zoom**: *Auto* (Standard, wie heute) oder *Fit*. - Die Spielseite nimmt diesen Wert. Feste Stufen wie 100 % gibt es dort nicht, weil die Fenstergröße der Spieler unbekannt ist. - Tests: Unit für den Faktor bei *Fit*, e2e 60 mit einem Projekt auf *Fit*. ## Offen (mit Vorschlag) 1. **Eigene Einstellung oder `gameScale` mitbenutzen?** Vorschlag: eine eigene. `gameScale` ist der Arbeitsmaßstab im Editor (Standard 100 %) und ändert sich beim Arbeiten ständig. 2. **Soll der Spieler selbst umschalten können**, etwa mit einem Knopf neben dem Vollbild? Vorschlag: nein.
meleki added the new label 2026-09-29 18:26:31 +02:00
admin added low-priorityquestion and removed new labels 2026-09-29 18:30:19 +02:00
admin added this to the Development project 2026-09-29 18:30:23 +02:00
admin moved this to Next in Development on 2026-10-02 10:37:31 +02:00
  1. vorschlag passt: eigene einstellung
  2. dein vorschlage: nein
1. vorschlag passt: eigene einstellung 2. dein vorschlage: nein
admin removed the question label 2026-10-02 10:38:41 +02:00
admin moved this to Done in Development on 2026-10-02 13:50:43 +02:00
Author
Owner

Done in c88f57c, wiki f8ee57b (Concepts, Architecture, Development).

What changes

  • Project settings has a row Link zoom with Auto (the default, as before) and Fit.
  • The page of the released game takes that value. With Fit the game fills the window in one direction, at whatever factor that takes. In the test (window 1280x800, camera 300x180) that is 4.267 where Auto stands at step 4, and the border left and right is gone.
  • A setting of its own (answer 1): the scale of the Game tab (gameScale) is not touched and does not reach the link.
  • No switch for the player (answer 2).
  • The change is an undo step. It reaches the link only with Update release, because the released copy is frozen.
  • A project that is there already reads as Auto, nothing changes for it.

Decided here

  • The row is called "Link zoom", not "Game link zoom" as proposed. The longer label is wider than the label column of the dialog, and its button stood 12 px out of line with the others in the screenshot.
  • The undo step keeps the name "Game link zoom", which is what the tooltip of the undo button shows.
  • A note under the row says "The released game at the largest whole step that fits, or filling the window."

Under the hood

  • project.gameLinkZoom ('auto' or 'fit') in src/core/model/playSettings.ts, read by gameLinkZoomOf. Anything that is not a choice reads as 'auto'. No format bump.
  • SetGameLinkZoomCommand in src/core/commands/projectCommands.ts.
  • GameScreen (src/player/GameScreen.ts) hands the field to cameraView where it passed a fixed 'auto'.

Tests

gate (melektaus-atx)   211 files, 3227 tests, CHECK EXIT 0 (3219 + 8)
e2e 60                 ALL PASSED - 19 checks (+3 for block 60i)
e2e 35,46,59,60        ALL PASSED - 74 checks
  • No full run and no smokes. The sum of 1671 (1668 + 3) in README and wiki is reckoned. 1668 is what CI counted for 9e869df (read in the log).
  • Eight unit tests: the default, saving and loading, values that are not a choice, undo, gameScale left alone, the factor of Fit for a window larger and smaller than the camera, and the rule behind Apply.
  • Three e2e checks in block 60i of module 60, with the real mouse: Auto to Fit in the dialog, update the release, open the link without a session and measure scale, frame and pixels.
  • Two screenshots looked at: the dialog with the new row, and the filled page of the game.
  • Not checked in the browser: Fit in a window smaller than the camera (a unit test covers it), and Fit under a display scale above 100 %. Nothing was looked at after the build.
Counter-check Result
9 in the unit tests all work
3 in the browser (the page ignores the setting, Apply writes the old value, the menu does not take the choice) all work
Done in `c88f57c`, wiki `f8ee57b` (*Concepts*, *Architecture*, *Development*). **What changes** - **Project settings has a row *Link zoom*** with **Auto** (the default, as before) and **Fit**. - **The page of the released game takes that value.** With Fit the game fills the window in one direction, at whatever factor that takes. In the test (window 1280x800, camera 300x180) that is 4.267 where Auto stands at step 4, and the border left and right is gone. - **A setting of its own** (answer 1): the scale of the Game tab (`gameScale`) is not touched and does not reach the link. - **No switch for the player** (answer 2). - The change is an undo step. It reaches the link only with **Update release**, because the released copy is frozen. - A project that is there already reads as Auto, nothing changes for it. **Decided here** - The row is called "Link zoom", not "Game link zoom" as proposed. The longer label is wider than the label column of the dialog, and its button stood 12 px out of line with the others in the screenshot. - The undo step keeps the name "Game link zoom", which is what the tooltip of the undo button shows. - A note under the row says "The released game at the largest whole step that fits, or filling the window." **Under the hood** - `project.gameLinkZoom` (`'auto'` or `'fit'`) in `src/core/model/playSettings.ts`, read by `gameLinkZoomOf`. Anything that is not a choice reads as `'auto'`. No format bump. - `SetGameLinkZoomCommand` in `src/core/commands/projectCommands.ts`. - `GameScreen` (`src/player/GameScreen.ts`) hands the field to `cameraView` where it passed a fixed `'auto'`. **Tests** ``` gate (melektaus-atx) 211 files, 3227 tests, CHECK EXIT 0 (3219 + 8) e2e 60 ALL PASSED - 19 checks (+3 for block 60i) e2e 35,46,59,60 ALL PASSED - 74 checks ``` - No full run and no smokes. The sum of 1671 (1668 + 3) in README and wiki is reckoned. 1668 is what CI counted for `9e869df` (read in the log). - Eight unit tests: the default, saving and loading, values that are not a choice, undo, `gameScale` left alone, the factor of Fit for a window larger and smaller than the camera, and the rule behind Apply. - Three e2e checks in block 60i of module 60, with the real mouse: Auto to Fit in the dialog, update the release, open the link without a session and measure scale, frame and pixels. - Two screenshots looked at: the dialog with the new row, and the filled page of the game. - **Not checked in the browser:** Fit in a window smaller than the camera (a unit test covers it), and Fit under a display scale above 100 %. Nothing was looked at after the build. | Counter-check | Result | |---|---| | 9 in the unit tests | all work | | 3 in the browser (the page ignores the setting, Apply writes the old value, the menu does not take the choice) | all work |
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: meleki/feuerwerk#279