-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: dead zone logic for auto-zoom to prevent jittery segments #1664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
namearth5005
wants to merge
7
commits into
CapSoftware:main
Choose a base branch
from
namearth5005:feat/auto-zoom-dead-zone
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5d54edd
Add AutoZoomConfig struct to extract hardcoded zoom constants into co…
namearth5005 ae39052
feat(settings): add auto_zoom_config to GeneralSettingsStore with ser…
namearth5005 04a7fed
feat(recording): wire AutoZoomConfig into zoom segment generation, re…
namearth5005 b893118
feat(ipc): pass AutoZoomConfig from settings through generate_zoom_se…
namearth5005 c866805
feat(ui): add zoom amount, sensitivity, and smoothing sliders for aut…
namearth5005 680a8e5
style: apply cargo fmt and biome formatting
namearth5005 e308026
feat(recording): add dead zone logic to prevent jittery auto-zoom seg…
namearth5005 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The centroid used for the dead zone check is recomputed as the average of all positions already in the group, including those added via previous dead zone merges. Each time a click near the boundary of the dead zone is accepted, the centroid shifts slightly in that direction, which may then accept the next click that is slightly further away, and so on.
Concretely with
dead_zone_radius = 0.1:(0.50, 0.50)→ centroid(0.50, 0.50)(0.56, 0.56)(dist ≈ 0.085 < 0.1) → merges, centroid shifts to(0.53, 0.53)(0.62, 0.62)(dist from new centroid ≈ 0.127 > 0.1) — just misses in this case, but with slightly smaller steps the group can creep across the screen.For the typical use case (same button clicked repeatedly) this is harmless, but a user doing a slow drag-with-pauses could inadvertently merge distant clicks into one group. One mitigation is to compute the centroid only from the first click in the group (i.e. the "anchor"), rather than from the running average of all members.
Prompt To Fix With AI