Show sharp tile preview labels and paths with tunnels and crossings
The mask labels under the tile preview sat inside the zoomed board. Pixi rendered them at 10 px and stretched them with the zoom, and each label was shrunk to the width of its tile on its own. They came out blurry and in different sizes. The example map also only showed a ring, so narrow paths and crossings were never previewed. - The labels live in their own layer in screen space and are re-rendered at the fitting font size on every zoom. - All labels share one size, at most the 10 px of the theme. Below 6 px they are hidden. - A label has two lines: the sides on top, the corners dimmed below. - The example map keeps the ring cell for cell and adds a network of 1 tile wide paths below it. It has straight 1xN and Nx1 pieces, curves, two T junctions, a crossing and a dead end. - The map stands next to the grid in a wide panel and below it in a tall one. Fit picks the layout with the larger tiles, and only Fit changes it, so zooming does not make the board jump. - The new hook __gm.tile.captions() reports size, scale and lines. Found on the way: the taller map made Fit zoom out further, and 3 pixel checks on the 16 px terrain tiles failed. The side by side layout fixed that. Tests: - ./check.sh: 160 files, 2364 tests, CHECK EXIT 0 (was 2363). - e2e 39: ALL PASSED, 29 checks (was 28). - New unit test: the example map has straights, a curve, a crossing with four notched corners, a T junction and a dead end. - Counter check: with the labels back in the zoomed board the new caption check fails (scales [0.648, 1]). - The e2e sum in the README is now 1381. It is calculated only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5dbac3a8df
commit
af6ac12ab5
6 files changed
+218
-27
No files matched your search
@@ -254,8 +254,9 @@ function combinationLabel(around: Neighbours, kind: TileKind): string {
|
||||
const NOTCH_ORDER = [1, 3, 2, 0];
|
||||
|
||||
/**
|
||||
* The little map the tab composes as a sample: a ring with a hole and a step, which is every
|
||||
* interesting case at once – outer corners, straight edges and, in the hole, the notches.
|
||||
* The little map the tab composes as a sample: a ring with a hole and a step – outer corners,
|
||||
* straight edges and, in the hole, the notches – and below it paths one tile wide: a tunnel
|
||||
* leaving the ring, both straights, bends, T-junctions, a crossing and a dead end.
|
||||
*/
|
||||
export const SAMPLE_PATTERN: readonly string[] = [
|
||||
'..........',
|
||||
@@ -265,7 +266,10 @@ export const SAMPLE_PATTERN: readonly string[] = [
|
||||
'.###..###.',
|
||||
'..######..',
|
||||
'...####...',
|
||||
'..........',
|
||||
'.....#....',
|
||||
'..#######.',
|
||||
'..#..#..#.',
|
||||
'#########.',
|
||||
];
|
||||
|
||||
export function patternCell(pattern: readonly string[], row: number, column: number): boolean {
|
||||
|
||||
Reference in new issue
Block a user