Skip to content

fix: calibration global offset (fix zone overlap/gap bug)#18

Merged
julio73 merged 3 commits intomainfrom
fix/calibration-global-offset
Mar 14, 2026
Merged

fix: calibration global offset (fix zone overlap/gap bug)#18
julio73 merged 3 commits intomainfrom
fix/calibration-global-offset

Conversation

@julio73
Copy link
Copy Markdown
Owner

@julio73 julio73 commented Mar 14, 2026

fix: apply calibration as global tap-coordinate offset instead of shifting zone boundaries

The previous approach shifted each key zone's boundaries by its per-key offset,
which broke grid tiling — adjacent zones would overlap or leave gaps, causing
wrong-key lookups.

New approach: compute a single global (median) dx/dy from the per-key calibration
samples, then subtract it from the raw tap coordinate before zone lookup. The grid
boundaries stay intact and perfectly tiled at all times.

julio73 added 3 commits March 14, 2026 21:18
…fting zone boundaries

The previous approach shifted each key zone's boundaries by its per-key offset,
which broke grid tiling — adjacent zones would overlap or leave gaps, causing
wrong-key lookups.

New approach: compute a single global (median) dx/dy from the per-key calibration
samples, then subtract it from the raw tap coordinate before zone lookup. The grid
boundaries stay intact and perfectly tiled at all times.
…) call and fix else scope

The merge of feat/configurable-force-press into fix/calibration-global-offset
left two broken artifacts in ContentView:
1. KeyGrid.default.applying(calibration:).zones — applying() was removed by
   the calibration PR; replaced with KeyGrid.default.zones (offset now applied
   at tap-coordinate level in TouchInputSession)
2. } else { DrawingCanvasView } was attached to an HStack instead of the
   enclosing if appMode == .keyboard block; moved the Divider + output HStack
   inside the keyboard branch so the else correctly toggles drawing mode
@julio73 julio73 merged commit 12a44eb into main Mar 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant