mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-27 04:38:29 +00:00
Merge pull request #7251 from ncic/snap-labels
Snap to Point draws no Smart Guides labels or lines with Smart Guides off
This commit is contained in:
@@ -568,8 +568,10 @@ impl Targets {
|
||||
}
|
||||
|
||||
/// View → Snap to Point: only these targets' anchors pull, and the ruler guides (shown and
|
||||
/// unlocked, as the selection tools pick them) pull the pointer into line where they run.
|
||||
pub(super) fn for_snap_to_point(self, cx: &ToolContext) -> Self {
|
||||
/// unlocked, as the selection tools pick them) pull the pointer into line where they run. It
|
||||
/// snaps without Smart Guides, so it draws none of their labels and lines.
|
||||
pub(super) fn for_snap_to_point(mut self, cx: &ToolContext) -> Self {
|
||||
self.style = GuideStyle { lines: false, labels: false, ..GuideStyle::of(cx) };
|
||||
self.anchors_only().with_rulers(cx)
|
||||
}
|
||||
|
||||
|
||||
@@ -952,3 +952,26 @@ fn a_drawn_point_lands_on_a_corner_of_a_glyphs_bounds() {
|
||||
assert!((q - tr).cross(dir).abs() < 1e-6, "angle {angle}: {q:?} is off the right edge");
|
||||
}
|
||||
}
|
||||
|
||||
/// With Smart Guides off, View → Snap to Point still pulls a drawn point onto an anchor, but
|
||||
/// draws no Smart Guides: no "anchor" label, no lines.
|
||||
#[test]
|
||||
fn snap_to_point_without_smart_guides_shows_no_guides() {
|
||||
let (d, _) = doc_with_rect();
|
||||
let (s, p) = (Selection::default(), paint());
|
||||
// Within Snap to Point's 2 px of the anchor at (200, 200).
|
||||
let at = Point::new(201.0, 199.0);
|
||||
let off = ToolContext { smart_guides: false, snap_to_point: true, ..cx(&d, &s, &p) };
|
||||
let mut snap = DrawSnap::default();
|
||||
assert_eq!(snap.hover(&off, at, &[], None), Point::new(200.0, 200.0));
|
||||
assert!(snap.guides().is_empty(), "{:?}", snap.guides());
|
||||
assert_eq!(snap.press(&off, at, &[], None), Point::new(200.0, 200.0));
|
||||
assert!(snap.guides().is_empty(), "{:?}", snap.guides());
|
||||
// A dragged selection's grabbed point too.
|
||||
let (q, ov) = Targets::snap_to_point(&off, &[]).unwrap().snap_point(at, 4.0);
|
||||
assert_eq!((q, ov.len()), (Point::new(200.0, 200.0), 0), "{ov:?}");
|
||||
// Smart Guides on: the same point says "anchor".
|
||||
let mut snap = DrawSnap::default();
|
||||
assert_eq!(snap.hover(&cx(&d, &s, &p), at, &[], None), Point::new(200.0, 200.0));
|
||||
assert_eq!(labels(snap.guides()), ["anchor"]);
|
||||
}
|
||||
|
||||
+3
-2
@@ -1,6 +1,6 @@
|
||||
# VectorCraft MCP server
|
||||
|
||||
> **Last updated:** 2026-11-13 · **Change:** Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter (#7097); existing response shapes retained. Previously: Save location-refusal error (#6146); existing response shapes retained.
|
||||
> **Last updated:** 2026-11-13 · **Change:** Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; no response-shape change. Previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter (#7097); existing response shapes retained.
|
||||
|
||||
`vectorcraft-cli mcp` runs a [Model Context Protocol](https://modelcontextprotocol.io) server on stdio
|
||||
(newline-delimited JSON-RPC 2.0; see [Protocol](#protocol) for version negotiation). Agents use it to
|
||||
@@ -5809,7 +5809,7 @@ The Selection & Anchor Display and General preferences apply to `pointer_gesture
|
||||
- `usePreciseCursors`: the Pen, Eyedropper, Slice and Blend tools' pointers are a crosshair.
|
||||
- `snapToPointTolerance` (1–8 px, 2 by default): with View › Snap to Point on and Smart Guides off (desktop app), the
|
||||
point a selection is dragged by, a drawn point and a transform tool's reference point land on an anchor or a ruler
|
||||
guide that near.
|
||||
guide that near, showing none of the Smart Guides labels or lines.
|
||||
- `moveLockedWithArtboard`: `artboard.move {moveArt: true}`, the Artboard tool and `artboard.rearrange` move locked and
|
||||
hidden art, and art that is also on a locked artboard, with the artboard too, and `artboard.setProps {scaleArt: true}`
|
||||
scales it too; off (the default) it stays where it is. `artboard.duplicate`, `artboard.copy` and `artboard.cut` copy or
|
||||
@@ -11520,5 +11520,6 @@ the error text. The interactive fallback applies only to ordinary File > Save, n
|
||||
|
||||
| Date | Change |
|
||||
|---|---|
|
||||
| 2026-11-13 | Snap to Point with Smart Guides off draws no Smart Guides labels or lines (#7250). |
|
||||
| 2026-11-13 | Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter (#7097). |
|
||||
| 2026-11-11 | Document READ_ONLY_LOCATION for saves (#6146); no response-shape change. |
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user