P4.4: selection highlight + score/moves HUD (sx, iOS sim)
Tap a gem to select it: BoardView hit-tests the touch to a grid cell and draws a bright rim + translucent fill over it; tapping the same cell clears the selection, tapping another moves it, tapping off-board clears it. Selection only — no swap (that's P5). The HUD renders the live score and remaining moves (out of the move limit) in the Lato font on a translucent card above the grid. The touch→cell geometry is factored into a pure BoardLayout (no GL/stb imports) that BoardView composes and P5 will reuse for swap endpoints. tests/hit_test.sx locks point_to_cell as the exact inverse of cell_frame (every cell center round-trips; off-board taps reject) — headless because BoardLayout pulls no C imports. goldens/p4_hud.png captures the scene after a real idb tap at (201,437)pt: the HUD plus a yellow selection rim on the red gem at cell (col 4, row 3).
This commit is contained in:
1
tests/expected/hit_test.exit
Normal file
1
tests/expected/hit_test.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
5
tests/expected/hit_test.stdout
Normal file
5
tests/expected/hit_test.stdout
Normal file
@@ -0,0 +1,5 @@
|
||||
grid origin (100,0) cell 75
|
||||
ok: 64/64 cell centers round-trip
|
||||
corner maps to (3,5)
|
||||
ok: 0 off-board taps resolved to a cell
|
||||
ok: hit-test mapping is the inverse of the layout
|
||||
Reference in New Issue
Block a user