diablo2-web/src/client/toolbar
troytt 26e4265e5b feat(client): formula-derived viewport profiles + 1068x600 / 1280x720
Derive every ViewportProfile's HUD anchors from its size instead of
hard-coded literals (1024x768 still yields 112 / 168 / 84):
  barOffsetX   = (W - 800) / 2
  barOffsetY   = H - 600
  panelOffsetY = (H - 600) / 2
and register two widescreen profiles next to 800x600 / 1024x768:
  1068x600 -> bar (134, 0),   panels y = 0,  center corridor 268px
  1280x720 -> bar (240, 120), panels y = 60, center corridor 480px

- viewport-profile: createViewportProfile() fails fast on an id/size
  mismatch, non-integer or sub-800x600 sizes and odd margins; add the
  strict getViewportProfileBySize(), isExtendedViewport() and
  formatViewportLabel(); id/object lookups resolve every profile.
- client-settings: whitelist the new ids (and bare-width shorthands).
- toolbar: the selector lists every profile; toggleViewport() cycles
  800 -> 1024 -> 1068 -> 1280 -> 800.
- hud-manager: every profile larger than 800x600 docks the panels at
  x = 0 / W - 400 with a W - 800 corridor (render + hit-testing);
  resize() resolves the exact registered profile or throws.
- command-mapper: ViewportCamera(width, height) resolves the exact
  registered profile or throws.
- play.html: keep the 800x600 Battle.net front-end canvas 4:3
  (pillarboxed) when the stage is sized for a 16:9 profile.

Tests: tests/client/viewport-formula-profiles.test.ts

TAG=agy
CONV=47cdfa86-71f2-47e6-b71e-1271cc315e1d
2026-10-02 06:22:40 +00:00
..
toolbar.css fix(toolbar): enforce single-row flex layout and remove server host control 2026-10-01 09:47:19 +00:00
toolbar.ts feat(client): formula-derived viewport profiles + 1068x600 / 1280x720 2026-10-02 06:22:40 +00:00