fix(drop-guide): snap to nearest cell in compass gaps to stop overlay flicker#1405
Merged
Conversation
… flicker The compass cells sit in a plus/cross with a small gap between collinear cells. Exact hit-testing returned null in those gaps, so the drop overlay (driven by the resolver) blinked out as the cursor crossed from one cell to its neighbour. Resolve now snaps a pointer sitting in an on-axis gap to its nearest collinear cell (within one gap); corners stay a genuine dead zone. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
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.



Problem
The drop-guide compass paints a plus/cross of fixed-size cells with a small gap between collinear cells. The drop overlay is driven by what
CompassResolver.resolve()returns, and exact hit-testing returnednullin those inter-cell gaps. So as the cursor crossed from one cell to its neighbour (e.g. centre → an arm), the resolver returnednullfor a frame and the translucent overlay blinked out, producing a janky flicker.Fix
After the exact-hit fast path,
resolve()now snaps a pointer sitting in an on-axis gap to its nearest collinear cell (within one gap width). The cells form a vertical column and a horizontal row; a pointer in the column's x-band or the row's y-band snaps to the nearest cell along that axis. A pointer off both axes (a genuine corner dead zone) still returnsnull, so intentional dead zones are preserved.Because
_clearFeedbackIfOffCellscalls the same resolver, the aimed-cell highlight stops clearing in the gaps too — overlay and highlight stay in lockstep automatically. This matches how VS/Qt dock guides behave: no dead band between adjacent aim targets.Tests
null); a corner still resolves tonull; a pointer more than a gap beyond the outermost cell still resolves tonull.🤖 Generated with Claude Code