Skip to content

Part of #394: Smart Guides display options and Snapping Tolerance - #453

Merged
bflatastic merged 2 commits into
storytold:mainfrom
wstock:fix/issue-394-smart-guides
Oct 8, 2026
Merged

bflatastic merged 2 commits into
storytold:mainfrom
wstock:fix/issue-394-smart-guides

Conversation

@wstock

@wstock wstock commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Part of #394. Seven of the Smart Guides preferences that were stored but read by nothing now do what their labels say, for the mouse and for agents (prefs.set, then pointer_gesture). The issue stays open for the rest.

Preferences › Smart Guides

  • Color: the smart guides' lines and labels take the preference's colour. Its default is now #ff3dfc, the magenta the tools have always drawn, so nothing changes until it is edited.
  • Alignment Guides off: no line is drawn along the edge or centre the art lines up with. The art still snaps into line (these are display options; snapping is unchanged).
  • Anchor/Path Labels off: no "anchor", "center", "path" or "align" label.
  • Measurement Labels off: no size or offset readout while drawing (shapes, the freehand family, slices), moving a selection, dragging a ruler guide, or drawing and resizing an artboard.
  • Transform Tools off: no readout while scaling or rotating with the Selection tool, Free Transform, or the Rotate/Scale/Shear/Reflect tools.
  • Object Highlighting off: the Selection tools no longer outline the object under the pointer. The outline now also needs View › Smart Guides on, since it is one of their display options.
  • Snapping Tolerance (0–40 px, 4 by default, as in Illustrator): replaces the 5 px hard-coded for every smart guide snap — drawn points, dragged selections, bounding-box handles, ruler guides, artboards and reference points. Snap to Point keeps its own snapToPointTolerance.

How

  • vectorcraft_tools::guides::GuideStyle (colour, lines, labels) rides on Targets (Targets::styled(cx)), so every snap method draws through two helpers instead of the MAGENTA literal; ToolContext gains the six fields and snap_tol(). The tools gate their Overlay::Measure readouts on measurement_labels / transform_tools_guides.
  • The engine fills them from Prefs in with_tool_cx (the colour parsed with vectorcraft_color::Color::from_hex, falling back to magenta); the canvas's hover outline checks object_highlighting and view.smart_guides.
  • docs/mcp.md (Selection preferences: a Smart Guides list, with what is still unread), ROADMAP (Shipped so far, UI chrome row).

Skipped (the tools draw neither yet): Construction Guides and their Angles, Spacing Guides.

Tests (each fails without the change)

  • tools: guides::display_options_colour_and_hide_the_guides_but_keep_the_snap, select::smart_guide_display_preferences_drive_the_readouts_and_the_pull (readouts per option; a handle 6 px from a target is pulled at tolerance 8, not at 4 or 0).
  • engine tests_prefs::smart_guide_display_preferences_filter_the_overlays: through prefs.set and real pointer gestures — colour, alignment lines off while the square still lines up, measurement and transform readouts, the tolerance, and the "anchor" label of a drawn corner.
  • ui-egui canvas::object_highlighting_preference_hides_the_hover_outline (headless egui frame with a pointer move).
  • cargo fmt --check; cargo clippy --all-targets -- -D warnings on tools, engine and ui-egui; cargo test -p vectorcraft-tools, -p vectorcraft-engine tests_prefs and -p vectorcraft-ui-egui canvas:: all pass (Linux, rebased on today's main after Part of #394: Preferences that act on selection, the wheel, tool tips and the grid #413/Part of #394: Preferences for snapping, handles, rubber bands, pattern tiles, tints and type #422). The only clippy complaint on a 1.99 toolchain is clippy::chunks_exact_to_as_chunks in cursors.rs (from [BUG] Mouse sluggish when moving over Vectorcraft #444, untouched here).

Parity source (feature names only): the Smart Guides preferences page, https://helpx.adobe.com/illustrator/using/smart-guides.html.

Developed with AI assistance (Claude Code); reviewed and tested locally.

wstock and others added 2 commits October 8, 2026 15:46
…rance

Color, Alignment Guides, Anchor/Path Labels, Measurement Labels,
Transform Tools, Object Highlighting and Snapping Tolerance are read:

- tools: `guides::GuideStyle` on `Targets` (`styled(cx)`) colours the
  lines and labels and leaves them out when their option is off, the
  snap itself unchanged; `ToolContext` gains the six fields and
  `snap_tol()`, replacing the 5 px literal for every smart guide snap
  (drawn points, moves, bounding-box handles, ruler guides, artboards,
  reference points). The tools gate their `Overlay::Measure` readouts on
  Measurement Labels (drawing, moving, ruler guides, artboards) or
  Transform Tools (scaling, rotating, Free Transform, transform tools).
- engine: `with_tool_cx` fills them from `Prefs` (the colour parsed, magenta
  as fallback); the colour's default is `#ff3dfc`, what the tools drew.
- ui-egui: the hover outline needs Object Highlighting and Smart Guides.
- Tests in tools (guides, select), engine (tests_prefs) and the canvas;
  docs/mcp.md and ROADMAP.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…m's move offset and slice readouts follow Measurement Labels (review of storytold#453)

- `Targets::align_rects` tells `snap_point_with` an axis lined up even when
  nothing moved or Alignment Guides hide the line, so the "align" label stays.
- Free Transform's move offset is a measurement label (as the Selection
  tool's), its scale/rotate readouts Transform Tools; slice move/resize
  readouts follow Measurement Labels.
- Snap to Point (Smart Guides off) keeps the default look for moves too, as
  for drawn points and guides.
- Test: guides dragged out of a ruler (storytold#451) follow Snapping Tolerance,
  Anchor/Path Labels and Measurement Labels; docs/mcp.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bflatastic
bflatastic force-pushed the fix/issue-394-smart-guides branch from 217795a to 42fced4 Compare October 8, 2026 08:50
@bflatastic
bflatastic merged commit fa405da into storytold:main Oct 8, 2026
@bflatastic

Copy link
Copy Markdown
Member

Thanks @wstock, and welcome! This is a really clean piece of work. GuideStyle on Targets and snap_tol() brought seven dead Smart Guides preferences to life with very little code, and the tests drive them through real gestures. I rebased it on main and added one commit on top (yours stays yours):

  • Ruler guides: I rebased it onto today's ruler-guide snapping (Part of #451: guides dragged out of the rulers snap, artboard guides #454), so guides dragged out of the rulers follow your Snapping Tolerance, Color, Anchor/Path Labels and Measurement Labels too. A test covers it.
  • Align label: the "align" label stays when an artboard handle is already exactly in line (Targets::align_rects), with a test.
  • Readouts: Free Transform's move offset and the Slice tool's move and resize readouts now follow Measurement Labels, and Free Transform's scale and rotate readouts follow Transform Tools, the same as the Selection tool.
  • Smart Guides off: Snap to Point keeps the default look for moves, and docs/mcp.md now lists what Measurement Labels covers.

Checked live in the app (colour, labels and alignment lines each switch off as expected while snapping still works) and over MCP (prefs.set plus pointer_gesture: a 6 px gap snaps at tolerance 8 but not at 4). If you'd like to chat with the team and other contributors, join us on our Discord: https://discord.gg/artcraft

@wstock
wstock deleted the fix/issue-394-smart-guides branch October 8, 2026 10:16
azmiruddinalif pushed a commit to azmiruddinalif/vectorcraft that referenced this pull request Oct 11, 2026
azmiruddinalif pushed a commit to azmiruddinalif/vectorcraft that referenced this pull request Oct 15, 2026
azmiruddinalif pushed a commit to azmiruddinalif/vectorcraft that referenced this pull request Oct 18, 2026
azmiruddinalif pushed a commit to azmiruddinalif/vectorcraft that referenced this pull request Nov 3, 2026
azmiruddinalif pushed a commit to azmiruddinalif/vectorcraft that referenced this pull request Nov 14, 2026
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.

2 participants