vectorcraft/crates/mcp/src
bflatastic 4eac7b505f Fix #506: drawing tools snap to Smart Guides as the Selection tool does
Every drawing tool now asks one snapper (guides::DrawSnap) for the points it
places: the Pen's and Curvature tool's anchors, the Pencil's ends, the shape
tools' start and dragged corner or radius (Rectangle, Rounded Rectangle,
Ellipse, Polygon, Star, Line Segment, Arc, Spiral, the grids), the Type tool's
click and frame and a new artboard's corners. Points land on other objects'
anchors, centres and paths ("anchor", "center", "path") or line up with their
anchors, edges and centres ("align"); hovering shows it before the press, the
Pen's guides end its rubber band, and the Pen lands on the path being drawn
too. Shift keeps a point to its 45-degree step (from Constrain Angle) or a
box's diagonal and slides it along that way into line with a target.
Preferences > Smart Guides > Construction Guides and Angles now act: a drawn
point near a guide through the point it leaves from lands on it.

Before, the Pen snapped only its press and showed nothing, and the shape tools
re-gathered targets on every drag step from the document showing their own
preview, so the dragged corner stuck to where the last step left it.

Performance: targets are gathered once per document state (keyed on the
document's uid and revision, now in ToolContext), from the art in the window,
and sorted, so the anchors, centres and lines near the pointer are found by
bisection. Leaving objects out of the targets no longer looks up each node's
ancestry (quadratic in the document's size): one pruned walk does it, which
also speeds up the Selection tool's moves and resizes.

The direction handles' HandleSnap (#494) is now a DrawSnap holding its own
targets (Targets::for_handle) for the drag: one cache, one lookup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 23:20:27 +07:00
..
backend.rs Robustness: VectorCraft never crashes — no panics in shipped code 2026-10-05 06:28:59 +07:00
headless.rs MCP: inspect_document slices too, stricter find filters (review of #416) 2026-10-08 09:17:06 +07:00
lib.rs Fix #494: Pen + Cmd edits the path being drawn; Pen + Alt reshapes segments; handle drags fixed and fast 2026-10-08 22:00:13 +07:00
logging.rs MCP: prompts, resource templates, completions and logging 2026-10-07 07:25:02 +07:00
prompts.rs MCP: prompts, resource templates, completions and logging 2026-10-07 07:25:02 +07:00
resources.rs MCP: slice summary reads with document.node depth and childLimit 2026-10-08 07:43:07 +07:00
server.rs MCP: a server sends log records only when its own client asked for them 2026-10-07 17:15:56 -04:00
tests.rs Fix #506: drawing tools snap to Smart Guides as the Selection tool does 2026-10-08 23:20:27 +07:00
tests_distortkeys.rs Fix #392: Cmd+A selects a focused field's text or the type being edited 2026-10-08 07:18:52 +07:00
tests_exportas.rs M4.33: Export As with Use Artboards (All or a range) and art bounds 2026-10-05 09:14:42 +07:00
tests_fileio.rs Fix #421: Document Color Mode can put RGB greys on the black plate 2026-10-08 10:30:32 +07:00
tests_freeform.rs M3.97: freeform points drag out to delete, spread ring drags, Lines mode draws lines 2026-10-05 04:43:43 +07:00
tests_gradient.rs M3.17: interactive gradient annotator — drag the start handle or the bar to move the gradient, the end handle to change length and angle, just past the end to rotate (Shift snaps to 45°); a bar click adds a stop, stops drag along the bar, off it to delete (never below two), Alt-drag copies, diamonds move midpoints; a click inside selected art applies the gradient from that point; double-clicking a stop opens a popover (Color/Swatches, Opacity, Location); the selected stop lives in the session (gradient.selectStop), shared by the tool, the Gradient and Color panels and agents, and takes Delete/Backspace and ←/→ ahead of their shortcuts (Tool::claims_key, also headless); stop chips draw as Overlay::Swatch with generated add/remove-stop cursors; the stop math moves into the color crate 2026-10-04 17:39:36 +07:00
tests_links.rs M4.53: Linked images remember their file and keep a preview; missing links ask Replace or Ignore, modified ones follow Update Links 2026-10-05 10:07:10 +07:00
tests_liquify.rs M8.4: Liquify keeps going while held, leaves non-paths alone, strokes apply incrementally 2026-10-06 12:00:52 +07:00
tests_pen.rs Fix #501: a Pen drag out of the first anchor always closes the path 2026-10-08 22:00:24 +07:00
tests_persp.rs M8.12: Perspective Selection tool scales, copies, moves perpendicular and nudges in perspective 2026-10-06 11:00:15 +07:00
tests_place.rs M4.25: Drop files on the canvas to place them; several placed files load the place cursor 2026-10-05 08:42:30 +07:00
tests_protocol.rs MCP: prompts, resource templates, completions and logging 2026-10-07 07:25:02 +07:00
tests_svg.rs M4.26: SVG Options in the engine, a dialog and MCP 2026-10-05 07:55:59 +07:00
tools.rs EPS import: other apps' EPS open as vectors, a preview that stands in says why 2026-10-08 18:23:36 +07:00