diff --git a/board_view.sx b/board_view.sx index a05e925..53295ec 100644 --- a/board_view.sx +++ b/board_view.sx @@ -27,6 +27,12 @@ // inside its cell tile rather than touching the tile's edges. GEM_FILL_FRAC :f32: 0.84; +// Content margin layered on top of the platform safe-area insets: frames the +// grid off the left/right screen bezel so the gems aren't flush to the edge. +// The grid is width-constrained on a portrait phone, so this is the inset that +// actually sizes it; vertical centering inside the safe area is unchanged. +BOARD_INSET_X :f32: 16.0; + // Selection overlay: a translucent warm fill plus a bright opaque rim around the // chosen cell. `add_stroked_rect` draws the rim in its FILL color (the renderer // ignores the separate stroke color), so SELECT_RIM is passed as the fill. @@ -204,7 +210,20 @@ BoardView :: struct { layout: BoardLayout; compute_layout :: (self: *BoardView, frame: Frame) { - self.layout.compute(frame, self.safe); + self.layout.compute(frame, self.content_insets()); + } + + // Platform safe-area insets widened by the content margin, so the grid (and + // the hit-test / banner geometry derived from it) is framed off the screen + // bezel. The HUD keeps using the bare safe insets, so it still hugs the top + // below the notch / Dynamic Island rather than shifting in with the board. + content_insets :: (self: *BoardView) -> EdgeInsets { + EdgeInsets.{ + top = self.safe.top, + left = self.safe.left + BOARD_INSET_X, + bottom = self.safe.bottom, + right = self.safe.right + BOARD_INSET_X, + } } // Draw gem `gem_index`'s sprite-sheet column into `gf`. diff --git a/goldens/p4_board.png b/goldens/p4_board.png index c1da52b..4c0629c 100644 Binary files a/goldens/p4_board.png and b/goldens/p4_board.png differ diff --git a/goldens/p4_hud.png b/goldens/p4_hud.png index 83b3bee..e892419 100644 Binary files a/goldens/p4_hud.png and b/goldens/p4_hud.png differ diff --git a/goldens/p6_idle_mid.png b/goldens/p6_idle_mid.png index 8d8d480..76b0d2e 100644 Binary files a/goldens/p6_idle_mid.png and b/goldens/p6_idle_mid.png differ diff --git a/goldens/p6_idle_t0.png b/goldens/p6_idle_t0.png index 14a70e5..3176c86 100644 Binary files a/goldens/p6_idle_t0.png and b/goldens/p6_idle_t0.png differ diff --git a/goldens/p6_select.png b/goldens/p6_select.png index 994eff0..cec6919 100644 Binary files a/goldens/p6_select.png and b/goldens/p6_select.png differ diff --git a/goldens/p7_lose.png b/goldens/p7_lose.png index b2eeaee..02ff9b5 100644 Binary files a/goldens/p7_lose.png and b/goldens/p7_lose.png differ diff --git a/goldens/p7_restart.png b/goldens/p7_restart.png index 7c938a4..30607b9 100644 Binary files a/goldens/p7_restart.png and b/goldens/p7_restart.png differ diff --git a/goldens/p7_win.png b/goldens/p7_win.png index a240486..13d8bec 100644 Binary files a/goldens/p7_win.png and b/goldens/p7_win.png differ diff --git a/goldens/p9_polish.png b/goldens/p9_polish.png new file mode 100644 index 0000000..ef114ee Binary files /dev/null and b/goldens/p9_polish.png differ