fix(engine): fill tableau fan to viewport on all aspect ratios #113
Reference in New Issue
Block a user
Delete Branch "fix/foldable-tableau-fan-fill"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
On a near-square viewport (Rhys, unfolded Galaxy Fold 7) a fresh deal leaves the bottom ~40% of the screen empty — the tableau is crammed under the HUD.
Root causes:
update_tableau_fan_fracmeasured only face-up column depth and returned early at a fresh deal (face-up depth 1), so it never spread the tableau; the deep face-down stacks were ignored.StateChangedEvent, so the event-driven fill never ran for it.compute_layout's sparse worst-case value.Fix
Moved the fill into
layout::apply_dynamic_tableau_fan, driven by each column's total weighted depth (face-down cards count, scaled by the face-down/face-up step ratio), so the deepest column fills the available height. Run it in three paths so every trigger stays filled:StateChangedEvent→ moveson_window_resizedaftercompute_layout→ the safe-area resize + fold/unfoldMAX_DYNAMIC_FAN_FRAC(0.6) caps the spread so a near-empty column keeps readable overlap;TABLEAU_FAN_FRACfloors it. Deeper columns drive the fraction down so everything still fits (no overflow).card_position/card_positionsread the same fractions, so hit-testing stays in sync.Also helps normal phones (less empty space at deal). Adds regression tests for the cold-start fill and the resize re-fill. Workspace clippy + tests green.
Verification note: logic is covered by unit tests; the on-screen feel (and the 0.6 cap) wants confirmation on the actual Fold 7 — emulator visual check was blocked (no touch injection on NativeActivity, non-debuggable APK, onboarding modal). Pairs with the merged card-move-jank fix (#112) for the bundled foldable release.
🤖 Generated with Claude Code