Skip to content

fix(drop-guide): snap to nearest cell in compass gaps to stop overlay flicker#1405

Merged
mathuo merged 1 commit into
v8-branchfrom
fix/drop-guide-gap-flicker
Jul 6, 2026
Merged

fix(drop-guide): snap to nearest cell in compass gaps to stop overlay flicker#1405
mathuo merged 1 commit into
v8-branchfrom
fix/drop-guide-gap-flicker

Conversation

@mathuo

@mathuo mathuo commented Jul 5, 2026

Copy link
Copy Markdown
Owner

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 returned null in those inter-cell gaps. So as the cursor crossed from one cell to its neighbour (e.g. centre → an arm), the resolver returned null for 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 returns null, so intentional dead zones are preserved.

Because _clearFeedbackIfOffCells calls 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

  • Added coverage: a pointer in the gap between two cells now snaps to the nearer cell (previously null); a corner still resolves to null; a pointer more than a gap beyond the outermost cell still resolves to null.
  • Full suite green (277/277), typecheck + prettier clean.

🤖 Generated with Claude Code

… 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>
@sonarqubecloud

sonarqubecloud Bot commented Jul 5, 2026

Copy link
Copy Markdown

@mathuo mathuo merged commit e8e8b70 into v8-branch Jul 6, 2026
9 checks 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