sbuffkin_hexmaker/dev
isaprettycoolguy@protonmail.com 6882a3b504 perf+fix: calibration handle sizing + snapshot-based drag/resize/nudge
Resize handles live inside the scaled bg-image (~4.8×) / grid (~0.35×) layers,
but --duckmage-cal-scale only cancelled the viewport zoom, so image handles
rendered ~5× too large and grid handles too small. updateCalHandleScale() now
sets the var per layer to 1/(zoom × layerScale) so handles stay a constant
on-screen size at any zoom/scale.

Calibration drag/resize/arrow-nudge was paint-bound at ~2fps: moving or scaling
the grid re-rasterises all 3843 clip-path hex cells every frame (a probe showed
~0.05ms JS work vs ~540ms frame gaps). During an active adjustment we now swap
the cells for a single pre-drawn <canvas> colour snapshot (buildCalibrationSnapshot)
— transforming one canvas is a single composite op — and drop icons/labels/the
SVG outline. Mouse drags coalesce moves to one rAF tick and tear down on mouseup;
arrow-key nudges use a bake-on-quiet settle timer (no mouseup to end on).

Adds a dev-gated drag probe (window.DUCKMAGE_PERF) and dev/cal-handle-size-check.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 07:04:12 -04:00
..
.gitignore feat: background image + grid calibration mode (1.4.0) 2026-06-17 17:01:24 -04:00
bg-hex-alignment-sandbox.html fix: grid expand/shrink preserves bg image alignment (1.4.1) 2026-06-17 18:18:53 -04:00
bg-hex-recalc-bench.html perf: cut redundant per-item work on map + table load 2026-06-30 07:03:23 -04:00
bg-hex-recalc-bench.mjs perf: cut redundant per-item work on map + table load 2026-06-30 07:03:23 -04:00
cal-handle-size-check.html perf+fix: calibration handle sizing + snapshot-based drag/resize/nudge 2026-06-30 07:04:12 -04:00
calibration-outline-overlay-sandbox.html feat: background image + grid calibration mode (1.4.0) 2026-06-17 17:01:24 -04:00
coord-label-thrash-bench.html fix: eliminate O(n²) layout thrash in renderCoordLabelsLayer (open-time stall) 2026-06-30 06:57:16 -04:00
coord-label-thrash-bench.mjs fix: eliminate O(n²) layout thrash in renderCoordLabelsLayer (open-time stall) 2026-06-30 06:57:16 -04:00
coord-slip-sandbox.html fix: coord labels no longer slip up-left during zoom bake 2026-06-21 11:09:12 -04:00
hex-calibration-sandbox.html feat: background image + grid calibration mode (1.4.0) 2026-06-17 17:01:24 -04:00
screenshot-approaches.mjs feat: background image + grid calibration mode (1.4.0) 2026-06-17 17:01:24 -04:00
snapshot-bg-hex-alignment.mjs fix: grid expand/shrink preserves bg image alignment (1.4.1) 2026-06-17 18:18:53 -04:00
snapshot-calibration-outline.mjs feat: background image + grid calibration mode (1.4.0) 2026-06-17 17:01:24 -04:00
snapshot-coord-slip.mjs fix: coord labels no longer slip up-left during zoom bake 2026-06-21 11:09:12 -04:00