feat(ui): F8-12 — map polish (zoom invariance, labels, selection, soft radius) (#55)
* Honest pixel-space sizing for `pointRadiusPx` / `strokeWidthPx`: the renderer divides by the current camera scale on every `viewport.zoomed` so thin lines / small markers stay the same on-screen size at any zoom. * Known-size planets switch to `pointRadiusWorld`, softened against the reference scale by `PLANET_SIZE_ZOOM_ALPHA = 0.33`; unidentified planets pin to a 3-px disc. * New planet label layer renders a two-line `name / #N` legend under each planet (`#N` only for unidentified or when the new `planetNames` toggle is off). Selection now paints an inverse-fill frame around the selected planet's label plus an outline on the disc; the old selection-ring primitive is retired. * Bombing markers swap the separate CirclePrim for a planet-outline overlay (damaged / wiped colour); the report deep-link moves to a "view bombing report" link in the planet inspector. * Docs + tests follow: `renderer.md` reflects the new sizing contract + label / outline layers, vitest covers the sizing math, label formatting, and the new toggle, and the map-toggles e2e adds a persistence case for `planetNames`. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -57,6 +57,14 @@ export interface MapToggles {
|
||||
cargoRoutes: boolean;
|
||||
battleMarkers: boolean;
|
||||
bombingMarkers: boolean;
|
||||
/**
|
||||
* planetNames toggles the on-map two-line label drawn under each
|
||||
* planet (F8-12 / issue #55, п.29). When ON, the first line shows
|
||||
* the planet name (when known) and the second line shows `#N`.
|
||||
* When OFF, the name line is suppressed for every planet — only
|
||||
* `#N` remains. Default ON.
|
||||
*/
|
||||
planetNames: boolean;
|
||||
/**
|
||||
* visibleHyperspace toggles the foggy overlay that darkens the
|
||||
* world OUTSIDE the union of `VisibilityDistance` circles around
|
||||
@@ -78,6 +86,7 @@ export const DEFAULT_MAP_TOGGLES: MapToggles = {
|
||||
cargoRoutes: true,
|
||||
battleMarkers: true,
|
||||
bombingMarkers: true,
|
||||
planetNames: true,
|
||||
visibleHyperspace: true,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user