Skip to content

Fix #593: anchors and handle ends are easier to grab than the segments through them - #612

Merged
bflatastic merged 1 commit into
mainfrom
fix/issue-593
Oct 8, 2026
Merged

bflatastic merged 1 commit into
mainfrom
fix/issue-593

Conversation

@bflatastic

Copy link
Copy Markdown
Member

Anchors are easier to grab with Direct Selection and the anchor tools: a press just off an anchor no longer slips onto the curve.

Cause: an anchor was picked only within the selection tolerance (3 px), the same reach as its segments. The anchor square is 5 px wide, so a press 3.5 px from its centre, still visually on the point's edge, grabbed the curve instead.

Fix: ToolContext::point_tol sets how far a press reaches for anchors and direction-handle ends: at least 2 px past the drawn point, or the Tolerance preference if that is larger.

  • At the default Size 3 that is 4.5 px. Size 7 (9 px squares) gives 6.5 px.
  • Anchors and handles are tested before segments, so when both are within reach the anchor wins. Segments, objects and area-type frame edges keep the plain tolerance.
  • Used by:
    • Direct Selection: press, Highlight anchors on mouse over, blend spine points and handles.
    • Anchor Point, Delete Anchor Point (including Alt from Add Anchor Point) and Scissors on an anchor.
    • The Pen's Alt conversions. The Pen's close/continue/auto-delete reach stays 5 px unless the points are drawn larger.
  • Of the topmost path with anchors in reach, the nearest anchor is picked (before, the first one listed).
  • anchor_size (Selection & Anchor Display › Size) is passed to the tools.

Test anchors_are_picked_before_the_segments_through_them:

  • A press 4.3 px from a corner and 0.5 px from its edge picks the corner. It picked the edge on main.
  • At 10 px it picks the segment, and at 5 px it is out of reach.
  • With Size 7 it reaches 6 px, with Tolerance 8 it reaches 7.5 px, and at 200% the reach scales.

Checked live on a curved path at 236%:

  • A Direct Selection press-drag 4.2 screen px from the middle anchor moves the anchor with its handles.
  • At 7 px it still grabs and bends the curve.

Checks

  • Based on origin/main c3b73f0.
  • cargo test -p vectorcraft-tools -p vectorcraft-engine -p vectorcraft-ui-egui.
  • cargo clippy --all-targets -- -D warnings for those three crates.
  • cargo fmt --all, cargo xtask wasm.

🤖 Generated with Claude Code

…s through them

An anchor was picked within the selection tolerance (3 px), the same reach
as its segments: a press a little off the anchor's 5 px square took the
curve instead.

- `ToolContext::point_tol`: anchors and direction handle ends are picked
  within the selection tolerance, but at least 2 px past the drawn point
  (4.5 px at the default Size 3, more with a larger Size). Anchors are
  tested before segments, so where both are within reach the anchor wins.
- Direct Selection (presses, Highlight anchors on mouse over, blend spine
  points and handles), the Anchor Point, Delete Anchor Point and Scissors
  tools, and the Pen (its Alt conversions; its close/continue reach stays
  5 px unless the points are drawn larger) use it. Segments, objects and
  frame edges keep the selection tolerance.
- Of the topmost path with anchors in reach, the nearest anchor is picked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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