fix(engine): share Draw-Three waste fan step between renderer and hit-test #106
Reference in New Issue
Block a user
Delete Branch "fix/draw-three-waste-fan-hittest"
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
The Draw-Three waste fan x-offset was computed two different ways:
card_plugin::card_positions)tableau_col_step * 0.224input_plugin::card_position)card_size.x * 0.28(hard-coded)These coincide on desktop/web (
col_step = 1.25*cw, and1.25 * 0.224 = 0.28) but drift on Android: tighter column spacing (H_GAP_DIVISOR=32,col_step ~= 1.03*cw) makes the renderer fan at~0.231*cwwhile the hit-test still expects0.28*cw. The top fanned waste card ends up ~14px left of its click target, so dragging the visible top card grabs the card beneath it.Fix
Extract
waste_fan_step()andtableau_col_step()as the single shared source, called by both the renderer and the hit-test so they can no longer diverge. Adds a regression test (draw_three_waste_hit_test_matches_render_fan_step) that simulates Android-tight spacing and asserts the hit target tracks the renderer.Desktop/web behaviour is unchanged (the formulas already coincided there). Relevant to the upcoming Android release.
🤖 Generated with Claude Code