fix: calibration global offset (fix zone overlap/gap bug)#18
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.