mirror of
https://github.com/sbuffkin/hexmaker.git
synced 2026-07-22 14:30:24 +00:00
Adding or removing a row/column from the top or left of the grid used to either visually bump the existing hexes (no compensation) or keep the hexes in place but drift the background image away from them (pan-only compensation). The fix pairs the pan shift with a matching shift of the bg image's offsetX/Y in viewport coordinates, so the bg and the hex grid both stay anchored in screen space after the click. Also replaces the hex-height-based stride formula with a direct measurement of the offsetTop/Left delta between two consecutive rows/cols. The old formula `hex.offsetHeight * 0.75` ignored the 0.15em hex margin and drifted ~5 px per click; the new approach captures everything that contributes to layout spacing. Includes a sandbox + headless-Chromium test (dev/bg-hex-alignment-sandbox.html + snapshot-bg-hex-alignment.mjs) that verifies the originally-top hex AND a fixed bg-image feature both stay within 0.6 px of their baseline screen position after one, three, or repeated top-expand clicks. |
||
|---|---|---|
| .. | ||
| .gitignore | ||
| bg-hex-alignment-sandbox.html | ||
| calibration-outline-overlay-sandbox.html | ||
| hex-calibration-sandbox.html | ||
| screenshot-approaches.mjs | ||
| snapshot-bg-hex-alignment.mjs | ||
| snapshot-calibration-outline.mjs | ||