diff --git a/CHANGELOG.md b/CHANGELOG.md index 33cc91a..c8db59b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,24 @@ project follows [Semantic Versioning](https://semver.org/). ## [Unreleased] +## [0.32.0] — 2026-05-16 + +### Fixed + +- **Stock-count badge overlaps waste pile on Android** (Bug 1). The badge was + centred 12 px inward from the stock pile's right edge, but its half-width of + 17 px pushed it 5 px past the edge. On Android (`H_GAP_DIVISOR = 32`) the + inter-pile gap is only ~4 px, so the badge's top-right corner covered the + left edge of the adjacent waste card at `Z_STOCK_BADGE = 30` (above the + card's Z ≈ 1). Fixed by moving the inset to 20 px so the badge right edge + sits 3 px inside the stock card on every device. +- **Oversized grey header bar** (Bug 2). The top HUD band was a full-width + `Node` with an opaque dark-grey `BackgroundColor` sized to `HUD_BAND_HEIGHT` + (64 px desktop / 80 px Android). Typical gameplay only shows one tier of + score text (~30 px), leaving a large empty grey block. Removed the + `BackgroundColor` from the band entity; the green felt now shows through and + only the score text and avatar button are visible in the header area. + ## [0.31.0] — 2026-05-16 ### Fixed diff --git a/solitaire_engine/src/card_plugin.rs b/solitaire_engine/src/card_plugin.rs index 23f91ce..e9b4a86 100644 --- a/solitaire_engine/src/card_plugin.rs +++ b/solitaire_engine/src/card_plugin.rs @@ -1614,10 +1614,11 @@ fn update_stock_empty_indicator( // --------------------------------------------------------------------------- /// Inset (in pixels) from the top-right corner of the stock pile sprite to -/// the centre of the count badge. A small inward offset keeps the chip from -/// drifting half-off the card while still reading as "attached" to the -/// corner. -const STOCK_BADGE_INSET: Vec2 = Vec2::new(-12.0, -8.0); +/// the centre of the count badge. Must satisfy `|x| >= STOCK_BADGE_SIZE.x / 2` +/// so the badge right edge stays inside the stock pile and never overlaps the +/// adjacent waste pile — critical on Android where `H_GAP_DIVISOR = 32` gives +/// an inter-pile gap of only ~4 px. +const STOCK_BADGE_INSET: Vec2 = Vec2::new(-20.0, -8.0); /// Width / height of the badge background sprite, in world pixels. Sized so /// a 2-digit count (max "24") fits comfortably with `TYPE_BODY` (14 pt) text. diff --git a/solitaire_engine/src/hud_plugin.rs b/solitaire_engine/src/hud_plugin.rs index 3685eb7..21dd792 100644 --- a/solitaire_engine/src/hud_plugin.rs +++ b/solitaire_engine/src/hud_plugin.rs @@ -479,16 +479,13 @@ impl Plugin for HudPlugin { } } -/// Spawns the translucent HUD band that anchors the action buttons -/// and primary readouts visually. Sits behind every other HUD element -/// (one z-rung below `Z_HUD`) so it reads as the band's "container" -/// without intercepting clicks from the buttons it sits under. +/// Spawns the invisible HUD band that reserves vertical space at the top of +/// the screen so the card layout (computed by `layout::compute_layout` using +/// `HUD_BAND_HEIGHT`) aligns correctly below the score readouts. /// -/// Width is full-window, height matches `layout::HUD_BAND_HEIGHT` (the -/// same constant the card layout reserves at the top), so the band's -/// bottom edge lines up exactly with the top edge of the highest -/// playable card. The fill is `BG_HUD_BAND` — midnight purple at 0.70 -/// alpha, so the green felt reads through subtly. +/// The entity carries no `BackgroundColor` — the green felt shows through. +/// A slim grey background is handled by each content section individually +/// (the bottom action bar has its own `BG_HUD_BAND` background). fn spawn_hud_band(insets: Option>, mut commands: Commands) { const BASE_TOP: f32 = 0.0; let top_inset = insets.as_deref().copied().unwrap_or_default().top; @@ -501,10 +498,6 @@ fn spawn_hud_band(insets: Option>, mut commands: Commands) { height: Val::Px(HUD_BAND_HEIGHT), ..default() }, - BackgroundColor(BG_HUD_BAND), - // Sit one z-rung below the HUD content so the buttons and text - // paint on top, but above the card sprites (which are 2D-world - // entities and rendered behind UI regardless). ZIndex(Z_HUD - 1), SafeAreaAnchoredTop { base_top: BASE_TOP }, HudBand,