mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-17 08:26:28 +00:00
Part of #8063: Dimension tool points snap to drawn dimensions and show anchor and path labels
A Linear point picked near the end of another dimension's line landed beside it when zoomed in: the tool's own pick skipped dimension artwork, so that end pulled the point only within the Smart Guides tolerance, while an anchor of the art pulls it from 8 pixels. - With Smart Guides or Snap to Point on, a point that no anchor of the art within 8 pixels takes lands on the end of a visible, unlocked dimension's dimension line, or on the far end of its extension line, within 8 pixels, with no link to that dimension. The end of an extension line next to the point it measures is not an end, so an anchor that a dimension already measures still takes the point. - A point that nothing else places lands on the closest point of such a line within 8 pixels, as it does on a segment of the art. - With Smart Guides and Anchor/Path Labels on, a point on an anchor or a line end shows the "anchor" label, and a point on a segment or line shows the "path" label. A point on a line end is marked as an anchor. - A press on a line end that moves a few pixels picks it, as a press on an anchor does. Docs: docs/dimensions.md, docs/target-app-parity.md.
This commit is contained in:
@@ -1805,6 +1805,134 @@ fn linear_picks_show_and_snap_to_smart_guides() {
|
||||
assert_eq!(text(&s, id), "60.02 pt");
|
||||
}
|
||||
|
||||
/// A shape with a curve at each top corner, for the tests of where Linear picks land.
|
||||
const CURVED_TOP: &str = "M130 358 C185 358 230 315 230 260 L425 260 C490 260 541 305 541 358 L541 440 L130 440 Z";
|
||||
|
||||
/// Where the next Linear click lands (the last marker the overlays draw, and its size) and the
|
||||
/// labels shown, with the pointer at (`x`, `y`).
|
||||
fn linear_marker(s: &mut Session, view: ViewInfo, x: f64, y: f64) -> (Option<(vectorcraft_geom::Point, f32)>, Vec<String>) {
|
||||
use vectorcraft_engine::tools::Overlay;
|
||||
s.pointer(&PointerEvent::new(PointerKind::Move, x, y), view).unwrap();
|
||||
let o = s.overlays(view);
|
||||
let at = o.iter().filter_map(|o| if let Overlay::Anchor { p, size, .. } = o { Some((*p, *size)) } else { None }).next_back();
|
||||
let labels = o.iter().filter_map(|o| if let Overlay::Label { text, .. } = o { Some(text.clone()) } else { None }).collect();
|
||||
(at, labels)
|
||||
}
|
||||
|
||||
/// A plain click at (`x`, `y`): the pointer moves there, then presses and releases.
|
||||
fn linear_click(s: &mut Session, view: ViewInfo, x: f64, y: f64) {
|
||||
for kind in [PointerKind::Move, PointerKind::Down, PointerKind::Up] {
|
||||
s.pointer(&PointerEvent::new(kind, x, y), view).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
/// Linear picks land on the anchors and paths of the art with an "anchor" or "path" label, and on
|
||||
/// the ends and lines of dimensions already drawn, from as far as on the art's anchors: zoomed in,
|
||||
/// a dimension started a few pixels from the end of another starts exactly at that end.
|
||||
#[test]
|
||||
fn linear_picks_land_on_anchors_paths_and_drawn_dimensions() {
|
||||
let (plain, zoomed) = (ViewInfo::default(), ViewInfo { zoom: 8.0, ..ViewInfo::default() });
|
||||
let mut s = session();
|
||||
run(&mut s, "path.create", json!({"d": CURVED_TOP}));
|
||||
run(&mut s, "select.none", json!({}));
|
||||
s.select_tool("dimension", plain).unwrap();
|
||||
let pt = vectorcraft_geom::Point::new;
|
||||
let hover = |s: &mut Session, view: ViewInfo, x: f64, y: f64| {
|
||||
let (at, labels) = linear_marker(s, view, x, y);
|
||||
(at.map(|(p, _)| p), labels)
|
||||
};
|
||||
// Beside the end of the curve: on the anchor, labeled.
|
||||
assert_eq!(hover(&mut s, plain, 231.0, 262.0), (Some(pt(230.0, 260.0)), vec!["anchor".to_string()]));
|
||||
// Beside the curve: on its closest point, labeled.
|
||||
let (at, labels) = hover(&mut s, plain, 200.0, 337.0);
|
||||
assert!(at.is_some_and(|q| q.distance(pt(200.0, 337.0)) < 6.0 && q != pt(200.0, 337.0)), "{at:?}");
|
||||
assert_eq!(labels, ["path"]);
|
||||
// A first dimension from the bottom of the curve to its top, placed above the art.
|
||||
linear_click(&mut s, plain, 130.0, 358.0);
|
||||
linear_click(&mut s, plain, 230.0, 260.0);
|
||||
linear_click(&mut s, plain, 180.0, 207.0);
|
||||
let first = s.doc().unwrap().selection.objects[0].0;
|
||||
assert_eq!((recipe(&s, first).a, recipe(&s, first).b), (pt(130.0, 358.0), pt(230.0, 260.0)));
|
||||
run(&mut s, "select.none", json!({}));
|
||||
s.select_tool("dimension", zoomed).unwrap();
|
||||
// Zoomed in, 5.8 pixels from the end of its dimension line: on that end, marked as an anchor.
|
||||
assert_eq!(linear_marker(&mut s, zoomed, 230.6, 207.4), (Some((pt(230.0, 207.0), 10.0)), vec!["anchor".to_string()]));
|
||||
// 6.4 pixels beside its extension line: on the line.
|
||||
let (at, labels) = hover(&mut s, zoomed, 230.8, 230.0);
|
||||
assert!(at.is_some_and(|q| (q.x - 230.0).abs() < 1e-6 && (q.y - 230.0).abs() < 1e-6), "{at:?}");
|
||||
assert_eq!(labels, ["path"]);
|
||||
// The next dimension starts where the first one's line ends.
|
||||
linear_click(&mut s, zoomed, 230.6, 207.4);
|
||||
linear_click(&mut s, zoomed, 425.0, 260.0);
|
||||
linear_click(&mut s, zoomed, 330.0, 207.0);
|
||||
let second = s.doc().unwrap().selection.objects[0].0;
|
||||
assert_ne!(second, first);
|
||||
let d = recipe(&s, second);
|
||||
assert!(near(d.a, pt(230.0, 207.0)) && near(d.b, pt(425.0, 260.0)), "{:?} {:?}", d.a, d.b);
|
||||
}
|
||||
|
||||
/// An anchor of the art that a dimension already measures takes a point picked beside it, not the
|
||||
/// end of the extension line a few points off it. A locked dimension pulls no point, and with
|
||||
/// Smart Guides and Snap to Point off no dimension pulls a point and no label shows. A press on
|
||||
/// the end of a dimension's line over a segment of the art that moves a few pixels before the
|
||||
/// release picks that end, as a press on an anchor does.
|
||||
#[test]
|
||||
fn an_anchor_beside_a_drawn_dimension_takes_the_point() {
|
||||
let (plain, zoomed) = (ViewInfo::default(), ViewInfo { zoom: 8.0, ..ViewInfo::default() });
|
||||
let off = ViewInfo { smart_guides: false, snap_to_point: false, ..zoomed };
|
||||
let mut s = session();
|
||||
run(&mut s, "path.create", json!({"d": CURVED_TOP}));
|
||||
run(&mut s, "select.none", json!({}));
|
||||
s.select_tool("dimension", plain).unwrap();
|
||||
let pt = vectorcraft_geom::Point::new;
|
||||
linear_click(&mut s, plain, 130.0, 358.0);
|
||||
linear_click(&mut s, plain, 230.0, 260.0);
|
||||
linear_click(&mut s, plain, 180.0, 207.0);
|
||||
let first = s.doc().unwrap().selection.objects[0].0;
|
||||
// Locked, the first dimension's line end does not pull a point 5.8 pixels away.
|
||||
run(&mut s, "object.lock", json!({}));
|
||||
let (at, _) = linear_marker(&mut s, zoomed, 230.6, 207.4);
|
||||
assert!(at.is_none_or(|(p, _)| p != pt(230.0, 207.0)), "a locked dimension: {at:?}");
|
||||
run(&mut s, "object.unlockAll", json!({}));
|
||||
run(&mut s, "select.none", json!({}));
|
||||
// 2.5 pixels above the curve's top anchor and 1.5 pixels below the end of the extension line
|
||||
// that starts 4 points above it: on the anchor, linked to the art.
|
||||
assert_eq!(linear_marker(&mut s, plain, 230.0, 257.5), (Some((pt(230.0, 260.0), 10.0)), vec!["anchor".to_string()]));
|
||||
// Smart Guides and Snap to Point off: no pull to the dimension's line end, and no labels.
|
||||
let (at, labels) = linear_marker(&mut s, off, 230.6, 207.4);
|
||||
assert!(at.is_none_or(|(p, _)| p != pt(230.0, 207.0)) && labels.is_empty(), "{at:?} {labels:?}");
|
||||
let (at, labels) = linear_marker(&mut s, off, 230.1, 260.1);
|
||||
assert!(at.is_some_and(|(p, _)| p == pt(230.0, 260.0)) && labels.is_empty(), "{at:?} {labels:?}");
|
||||
// Snap to Point on and Smart Guides off: the line end takes the point, and no label shows.
|
||||
assert_eq!(linear_marker(&mut s, ViewInfo { snap_to_point: true, ..off }, 230.6, 207.4), (Some((pt(230.0, 207.0), 10.0)), vec![]));
|
||||
// A second dimension whose line lies on the bottom edge, from x 425 to x 541.
|
||||
linear_click(&mut s, plain, 425.0, 260.0);
|
||||
linear_click(&mut s, plain, 541.0, 358.0);
|
||||
linear_click(&mut s, plain, 480.0, 440.0);
|
||||
let second = s.doc().unwrap().selection.objects[0].0;
|
||||
assert_ne!(second, first);
|
||||
run(&mut s, "select.none", json!({}));
|
||||
// A press 1.4 pixels from its line's left end, on the bottom edge, moved 5 pixels: the end is
|
||||
// picked, and no dimension of the edge is dragged out.
|
||||
for (kind, x) in [(PointerKind::Move, 426.0), (PointerKind::Down, 426.0), (PointerKind::Drag, 431.0), (PointerKind::Up, 431.0)] {
|
||||
s.pointer(&PointerEvent::new(kind, x, 441.0), plain).unwrap();
|
||||
}
|
||||
linear_click(&mut s, plain, 541.0, 440.0);
|
||||
linear_click(&mut s, plain, 480.0, 470.0);
|
||||
let third = s.doc().unwrap().selection.objects[0].0;
|
||||
assert_ne!(third, second);
|
||||
let d = recipe(&s, third);
|
||||
assert!(near(d.a, pt(425.0, 440.0)) && near(d.b, pt(541.0, 440.0)), "{:?} {:?}", d.a, d.b);
|
||||
// A dimension of the left edge whose line lies 4 points off it, where its extension lines
|
||||
// start: zoomed in, the end of its line still takes a point 4.7 pixels away.
|
||||
run(&mut s, "select.none", json!({}));
|
||||
linear_click(&mut s, plain, 130.0, 358.0);
|
||||
linear_click(&mut s, plain, 130.0, 440.0);
|
||||
linear_click(&mut s, plain, 126.0, 400.0);
|
||||
run(&mut s, "select.none", json!({}));
|
||||
assert_eq!(linear_marker(&mut s, zoomed, 125.5, 358.3), (Some((pt(126.0, 358.0), 10.0)), vec!["anchor".to_string()]));
|
||||
}
|
||||
|
||||
/// The page content streams of exported PDF `v`, inflated.
|
||||
fn pdf_content(v: &Value) -> String {
|
||||
let bytes = vectorcraft_format::base64_decode(v["dataBase64"].as_str().unwrap()).unwrap();
|
||||
|
||||
+116
-11
@@ -67,6 +67,9 @@ pub struct DimensionTool {
|
||||
snap: crate::guides::DrawSnap,
|
||||
/// Where the next Linear pick lands, as last worked out for the pointer (for the overlays).
|
||||
snapped: Option<(Point, Option<PointRef>)>,
|
||||
/// Whether the last Linear pick worked out landed on the end of a line of a dimension already
|
||||
/// drawn (shown as an anchor).
|
||||
on_end: bool,
|
||||
/// Whether the press under way began on an anchor a Linear click picks.
|
||||
press_on_anchor: bool,
|
||||
/// The second point clicked for the Linear dimension being placed, and where the pointer was
|
||||
@@ -199,6 +202,89 @@ fn anchor_under(cx: &ToolContext, p: Point) -> Option<(Point, PointRef)> {
|
||||
best.map(|(_, at, r)| (at, r))
|
||||
}
|
||||
|
||||
/// Where a pick at `p` lands on the artwork of the visible, unlocked dimensions already drawn,
|
||||
/// with no link to it: the nearest end of one of their lines (dimension and extension lines)
|
||||
/// within the anchor reach, as an anchor (`true`); else the nearest point of one of those lines
|
||||
/// within 8 pixels (`false`). The end of an extension line next to the point it measures is not
|
||||
/// an end here: it lies a few points off that point. Only with Smart Guides or Snap to Point on.
|
||||
/// Bounded work, and the topmost dimension wins a tie, as in [`anchor_under`].
|
||||
fn on_dimensions(cx: &ToolContext, p: Point) -> Option<(Point, bool)> {
|
||||
use vectorcraft_geom::kurbo::{ParamCurve, ParamCurveNearest};
|
||||
#[derive(Default)]
|
||||
struct Best {
|
||||
end: Option<(f64, Point)>,
|
||||
line: Option<(f64, Point)>,
|
||||
}
|
||||
/// `measured`: a linear dimension's measured points and how far its extension lines start
|
||||
/// from them.
|
||||
fn lines(n: &Node, measured: Option<([Point; 2], f64)>, p: Point, reach: [f64; 2], budget: &mut usize, best: &mut Best) {
|
||||
if *budget == 0 || !n.visible || n.locked {
|
||||
return;
|
||||
}
|
||||
if let Some(path) = n.path_data() {
|
||||
// Open subpaths only: the lines, not a filled arrowhead.
|
||||
for sp in path.subpaths.iter().filter(|sp| !sp.closed) {
|
||||
// An extension line starts at the offset from its measured point and runs straight
|
||||
// away from it; the dimension line runs across that direction. With no offset its
|
||||
// start is the measured point itself, and stays an end.
|
||||
let extension_start = |a: Point, b: Point| {
|
||||
measured.is_some_and(|(points, offset)| {
|
||||
points.iter().any(|m| {
|
||||
let (out, along) = (a - *m, b - a);
|
||||
offset > 1e-6 && (out.hypot() - offset).abs() <= 1e-6 && out.dot(along) >= (1.0 - 1e-6) * out.hypot() * along.hypot()
|
||||
})
|
||||
})
|
||||
};
|
||||
let (Some(first), Some(last)) = (sp.anchors.first(), sp.anchors.last()) else { continue };
|
||||
let skip_first = extension_start(first.p, last.p);
|
||||
for a in [first, last].into_iter().skip(usize::from(skip_first)) {
|
||||
let d = a.p.distance(p);
|
||||
if d <= reach[0] && best.end.is_none_or(|(near, _)| d < near) {
|
||||
best.end = Some((d, a.p));
|
||||
}
|
||||
}
|
||||
for i in 0..sp.segment_count() {
|
||||
if *budget == 0 {
|
||||
return;
|
||||
}
|
||||
*budget -= 1;
|
||||
let c = sp.segment(i);
|
||||
let q = c.eval(c.nearest(p, 1e-4).t);
|
||||
let d = q.distance(p);
|
||||
if q.x.is_finite() && q.y.is_finite() && d <= reach[1] && best.line.is_none_or(|(near, _)| d < near) {
|
||||
best.line = Some((d, q));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for c in n.children().into_iter().flatten().rev() {
|
||||
lines(c, measured, p, reach, budget, best);
|
||||
}
|
||||
}
|
||||
fn visit(n: &Node, p: Point, reach: [f64; 2], budget: &mut usize, best: &mut Best) {
|
||||
if *budget == 0 || !n.visible || n.locked {
|
||||
return;
|
||||
}
|
||||
*budget -= 1;
|
||||
if let Some(d) = &n.extras().dimension {
|
||||
let measured = (d.mode == DimensionMode::Linear).then_some(([d.a, d.b], d.options.extension_offset));
|
||||
lines(n, measured, p, reach, budget, best);
|
||||
return;
|
||||
}
|
||||
for c in n.children().into_iter().flatten().rev() {
|
||||
visit(c, p, reach, budget, best);
|
||||
}
|
||||
}
|
||||
if !(cx.smart_guides || cx.snap_to_point) {
|
||||
return None;
|
||||
}
|
||||
let (reach, mut budget, mut best) = ([cx.tol(ANCHOR_REACH), cx.tol(8.0)], 20_000usize, Best::default());
|
||||
for n in cx.doc.layers.iter().rev() {
|
||||
visit(n, p, reach, &mut budget, &mut best);
|
||||
}
|
||||
best.end.map(|(_, q)| (q, true)).or_else(|| best.line.map(|(_, q)| (q, false)))
|
||||
}
|
||||
|
||||
/// The point of `edge` closest to `p`.
|
||||
fn nearest_on(cx: &ToolContext, edge: &SegmentRef, p: Point) -> Option<Point> {
|
||||
use vectorcraft_geom::kurbo::ParamCurveNearest;
|
||||
@@ -239,12 +325,13 @@ fn points_source(cx: &ToolContext, (a, ra): (Point, &Option<PointRef>), (b, rb):
|
||||
|
||||
impl DimensionTool {
|
||||
/// Where a Linear pick at `p` lands: on the nearest anchor of any path, within reach (kept as
|
||||
/// a link to its path); else where Smart Guides put it (another object's anchor or centre, in
|
||||
/// a link to its path), labeled "anchor"; else on the nearest end of a line of a dimension
|
||||
/// already drawn, within the same reach (no link), also labeled "anchor"; else where Smart Guides put it (another object's anchor or centre, in
|
||||
/// line with one, or for the second point square to a segment or grazing a curve from the
|
||||
/// first with Snap to Perpendicular or Snap to Tangent on, or on a construction guide through
|
||||
/// a first point picked on an anchor), its guides showing; else on the closest point of the
|
||||
/// line under the pointer; else `p` itself. A first point not on an anchor has no
|
||||
/// construction guides through it.
|
||||
/// line under the pointer, of the art or of a dimension, labeled "path"; else `p` itself. A
|
||||
/// first point not on an anchor has no construction guides through it.
|
||||
/// A point the guides leave where the pointer is (right on a guide line) stays there, and with
|
||||
/// Snap to Pixel or Snap to Grid on a point stays where they place it.
|
||||
fn snap_linear(&mut self, cx: &ToolContext, p: Point) -> (Point, Option<PointRef>) {
|
||||
@@ -253,15 +340,31 @@ impl DimensionTool {
|
||||
None => crate::guides::Leave::contact(*first),
|
||||
});
|
||||
let guided = self.snap.hover(cx, p, &[], leave.as_ref());
|
||||
self.on_end = false;
|
||||
if let Some((point, reference)) = anchor_under(cx, p) {
|
||||
self.snap.clear();
|
||||
self.snap.label(point, "anchor");
|
||||
return (point, Some(reference));
|
||||
}
|
||||
let drawn = on_dimensions(cx, p);
|
||||
if let Some((q, true)) = drawn {
|
||||
self.on_end = true;
|
||||
self.snap.label(q, "anchor");
|
||||
return (q, None);
|
||||
}
|
||||
if guided.distance(p) > 1e-9 || !self.snap.guides().is_empty() || cx.snap_to_pixel || cx.snap_to_grid {
|
||||
return (guided, None);
|
||||
}
|
||||
// Not on an anchor or a guide: snap to the closest point of the line (#2432).
|
||||
(pick(cx, p).and_then(|e| nearest_on(cx, &e, p)).unwrap_or(p), None)
|
||||
// Not on an anchor or a guide: snap to the closest point of the line (#2432), of the art
|
||||
// or of a dimension already drawn.
|
||||
let art = pick(cx, p).and_then(|e| nearest_on(cx, &e, p));
|
||||
let line = drawn.map(|(q, _)| q);
|
||||
match art.into_iter().chain(line).min_by(|a, b| a.distance(p).total_cmp(&b.distance(p))) {
|
||||
Some(q) => {
|
||||
self.snap.label(q, "path");
|
||||
(q, None)
|
||||
}
|
||||
None => (p, None),
|
||||
}
|
||||
}
|
||||
fn target(&self, cx: &ToolContext, p: Point) -> Option<Target> {
|
||||
let edge = pick(cx, p)?;
|
||||
@@ -384,6 +487,7 @@ impl DimensionTool {
|
||||
self.pending = None;
|
||||
self.press = None;
|
||||
self.press_on_anchor = false;
|
||||
self.on_end = false;
|
||||
self.points.clear();
|
||||
self.lines.clear();
|
||||
self.dragging = false;
|
||||
@@ -498,10 +602,11 @@ impl Tool for DimensionTool {
|
||||
self.press = Some((ev.pos, None));
|
||||
return self.preview(cx, ev.pos);
|
||||
}
|
||||
// A Linear press on an anchor picks the anchor unless it drags past the anchor's
|
||||
// reach: moving a few pixels before the release does not drag out the dimension of
|
||||
// a segment under the pointer.
|
||||
self.press_on_anchor = self.kind == Kind::Linear && anchor_under(cx, ev.pos).is_some();
|
||||
// A Linear press on an anchor, or on the end of a dimension's line, picks it unless
|
||||
// it drags past the anchor's reach: moving a few pixels before the release does not
|
||||
// drag out the dimension of a segment under the pointer.
|
||||
self.press_on_anchor =
|
||||
self.kind == Kind::Linear && (anchor_under(cx, ev.pos).is_some() || on_dimensions(cx, ev.pos).is_some_and(|(_, end)| end));
|
||||
self.press = Some((ev.pos, self.target(cx, ev.pos)));
|
||||
vec![]
|
||||
}
|
||||
@@ -617,7 +722,7 @@ impl Tool for DimensionTool {
|
||||
if let Some((q, reference)) = &snapped
|
||||
&& (reference.is_some() || q.distance(self.at) > 1e-9)
|
||||
{
|
||||
let on_anchor = reference.is_some();
|
||||
let on_anchor = reference.is_some() || self.on_end;
|
||||
out.push(Overlay::Anchor { p: *q, color, filled: !on_anchor, size: if on_anchor { 10.0 } else { 6.0 } });
|
||||
}
|
||||
if let Some((p, _)) = self.points.last() {
|
||||
|
||||
@@ -485,6 +485,17 @@ impl DrawSnap {
|
||||
self.guides.clear();
|
||||
}
|
||||
|
||||
/// Replace the guides with one label `text` at `p`, for a point a tool placed by a rule of its
|
||||
/// own (an anchor or a path it found itself). The label uses the style of the targets the last
|
||||
/// snap gathered. No label shows when Smart Guides or Anchor/Path Labels are off (Snap to Point
|
||||
/// alone gathers targets without labels), or when the last snap gathered no targets.
|
||||
pub(crate) fn label(&mut self, p: Point, text: &str) {
|
||||
self.guides = match &self.targets {
|
||||
Some((_, PointSnap { targets: Some((t, _)), .. })) => t.label(p, text).into_iter().collect(),
|
||||
_ => vec![],
|
||||
};
|
||||
}
|
||||
|
||||
fn gather(&mut self, cx: &ToolContext, key: SnapKey) {
|
||||
let snap = PointSnap::new(cx, || Targets::for_drawing(cx.doc, &key.exclude, visible(cx), key.snap_to_glyph));
|
||||
self.targets = Some((Some(key), snap));
|
||||
|
||||
@@ -509,7 +509,7 @@ impl Targets {
|
||||
}
|
||||
|
||||
/// A label `text` at `p`, unless Anchor/Path Labels are off.
|
||||
fn label(&self, p: Point, text: &str) -> Option<Overlay> {
|
||||
pub(super) fn label(&self, p: Point, text: &str) -> Option<Overlay> {
|
||||
self.style.labels.then(|| Overlay::Label { p, text: text.into(), color: self.style.color })
|
||||
}
|
||||
|
||||
|
||||
+8
-3
@@ -20,12 +20,17 @@ The **Dimension Tool** is in the Modify section of the toolbar. Its strip offers
|
||||
first point was picked on an anchor, the second also snaps onto the construction guides through
|
||||
it; any other first point has no construction guides through it. The guides
|
||||
show while hovering, before each click. VectorCraft's own rules decide where a point lands: an
|
||||
anchor within 8 pixels takes it first; a point on a guide stays on the guide where the pointer
|
||||
anchor within 8 pixels takes it first; with Smart Guides or Snap to Point on, the end of a line
|
||||
of a visible, unlocked dimension already drawn (its dimension line, or the far end of an
|
||||
extension line) within 8 pixels takes it next, without a link to that dimension; a point on a
|
||||
guide stays on the guide where the pointer
|
||||
is, except that it moves onto a segment within the Smart Guides snapping tolerance, or, on a
|
||||
construction guide or a Snap to Glyph guide that runs at an angle, onto the place where that
|
||||
guide crosses another object's alignment line within twice that tolerance; a point that no
|
||||
anchor, guide, grid or pixel snapping places lands on the closest point of a segment within 8
|
||||
pixels.
|
||||
anchor, guide, grid or pixel snapping places lands on the closest point of a segment, or of a
|
||||
line of a dimension already drawn, within 8 pixels. With Smart Guides and Anchor/Path Labels
|
||||
on, a point on an anchor or a line end shows the "anchor" label, and a point on a segment or
|
||||
line shows the "path" label. These rules apply to the Linear points.
|
||||
A linear dimension is aligned, horizontal or vertical, as the
|
||||
[linear dimensions help](https://helpx.adobe.com/illustrator/desktop/measure-and-align/plot-and-measure/plot-linear-dimensions-of-objects.html)
|
||||
describes: after the second click, clicking again places an aligned dimension, and moving the
|
||||
|
||||
@@ -618,6 +618,7 @@ since 2026-10-01.
|
||||
**Drawing tools, Dimension tool points that are not anchors follow the art:** A clicked point on a segment stays at its place along the segment, also when the segment curves, and a point off the art is linked to anchors (or, when the anchors lie on one line, anchors and handles) of the path, so both ends of the dimension follow when the art is moved, scaled, turned or reflected, also when the point was placed by a Smart Guide and when the dimension is saved and opened again; a linked linear dimension of reflected art (other than art on one line) has its line on the reflected side; deleting the art, changing its anchor count or whether it is closed, turning an angle's arm into a curve, or making a measured circle or arc no longer circular leaves the dimension where it was, no longer linked, instead of removing it. `a_dimension_to_a_point_on_a_segment_follows_the_art_at_both_ends`, `a_dimension_to_a_point_off_the_art_moves_with_the_art`, `a_dimension_whose_art_changes_its_anchors_stays_where_it_was`, `a_dimension_whose_art_is_opened_stays_where_it_was`, `angle_and_arc_dimensions_whose_art_no_longer_fits_stay_where_they_were`, `a_dimension_that_cannot_be_drawn_again_keeps_its_art`, `a_linked_dimension_of_reflected_art_has_its_line_on_the_reflected_side`, `a_dimension_to_a_point_off_a_line_follows_the_line`, `a_point_off_an_arch_is_reflected_with_the_arch`, `a_point_beside_an_almost_straight_curve_follows_it`, `a_point_off_a_loop_with_its_anchors_in_one_place_follows_it`, `a_point_beside_a_reflected_line_moves_as_a_half_turn_would`, `a_point_on_a_segment_stays_on_it_when_the_segment_curves`, `a_linked_dimension_of_a_reflected_curve_has_its_line_on_the_reflected_side`, `a_dimension_of_art_reflected_across_its_points_changes_sides`, `a_dimension_between_paths_reflected_each_in_its_own_way_keeps_its_offset`, `free_points_survive_a_native_file`, `dimension_free_points_are_checked`, `points_off_anchors_are_held_against_the_path` and `a_point_smart_guides_place_is_held_against_the_path` cover it.
|
||||
**Drawing tools, Dimension tool points on a Smart Guide stay on the guide:** By VectorCraft's own rule, a clicked point that lies on a Smart Guide already, such as one in line with an object's center, stays where the pointer is when no anchor is within 8 pixels and no segment is within the Smart Guides snapping tolerance, instead of moving onto a segment farther than that tolerance and within 8 pixels; with Snap to Grid or Snap to Pixel on, a point stays on the grid or the whole pixel those options give. `a_point_on_a_guide_stays_on_the_guide` covers it.
|
||||
**Drawing tools, Dimension tool second point without construction guides through a first point off the anchors:** By VectorCraft's own rule, with Smart Guides on, the second Linear point does not snap to the construction guides through a first point that is not on an anchor, so a click beside a segment straight below such a first point lands on the segment; after a first point picked on an anchor, the construction guides through it still apply. The second point still snaps to anchors, centers and alignment lines, and with Snap to Perpendicular or Snap to Tangent on, it lands where the line from the first point meets a segment square or grazes a curve. `a_point_on_a_guide_stays_on_the_guide`, `the_second_point_after_an_anchor_lands_on_construction_guides`, `the_second_point_lands_square_to_a_segment_or_grazing_a_curve` and `linear_picks_show_and_snap_to_smart_guides` cover it.
|
||||
**Drawing tools, Dimension tool points land on dimensions already drawn (#8063):** By VectorCraft's own rule, with Smart Guides or Snap to Point on, a Linear point that no anchor of the art within 8 pixels takes lands on the end of a visible, unlocked dimension's dimension line, or on the far end of its extension line, within 8 pixels, and a point that nothing else places lands on the closest point of such a line within 8 pixels, so at any zoom a dimension can start where another one ends. The end of an extension line next to the point it measures does not pull points away from that anchor. With Smart Guides and Anchor/Path Labels on, a point on an anchor or line end shows the "anchor" label and a point on a segment or line shows the "path" label. `linear_picks_land_on_anchors_paths_and_drawn_dimensions` and `an_anchor_beside_a_drawn_dimension_takes_the_point` cover it.
|
||||
**Drawing tools, Dimension tool dimensions selected with their art keep their lines and label:** Object › Expand, Object › Expand Appearance and Object › Path › Outline Stroke leave a dimension selected with art it measures, directly or in selected groups without fills, strokes or effects of their own, as it is and change only the other art; when the new art no longer fits its link, the dimension stays where it was, no longer linked, and undo links it again. `expand_leaves_a_dimension_selected_with_its_art_as_it_is`, `expand_appearance_leaves_a_dimension_selected_with_its_art_as_it_is`, `outline_stroke_leaves_a_dimension_selected_with_its_art_as_it_is`, `a_dimension_selected_with_art_that_has_nothing_to_expand_changes_nothing`, `a_group_effect_expanded_reaches_the_dimension_it_holds`, `expand_keeps_a_dimension_in_its_asset_and_its_variable_binding`, `a_dimension_keeps_no_link_to_the_art_expand_replaced`, `a_dimension_outlasts_the_art_outline_stroke_or_expand_appearance_replaced`, `a_dimension_outlasts_the_stroke_expand_outlined` and `expand_appearance_in_safe_mode_leaves_a_dimension_selected_with_its_art` cover it.
|
||||
**Drawing tools, Line Segment from one curve onto a common tangent of another:** By VectorCraft's own rule, with Smart Guides and Snap to Tangent on, a Line Segment drag pressed anywhere on a convex closed path with curves and dragged to within the snapping tolerance of another such path lands on a common tangent of the two ([tangent lines to circles](https://en.wikipedia.org/wiki/Tangent_lines_to_circles)): both ends move to where the line touches the paths, the start sliding along the first path, and each end shows the "tangent" label when Anchor/Path Labels is on, with the line drawn as a guide when Alignment Guides is on. The line is the tangent whose touch point on the second path is nearest the pointer, so moving the pointer around the second path switches between the outer tangent and the one crossing between the paths. The start stays where it was pressed when Shift, Alt or Space is held, when an anchor, center or crossing lies nearer the pointer than the second path does, when the press snapped to an anchor, center or crossing off the first path, when Snap to Tangent is off, when Snap to Grid or pixel snapping places drawn points, or when either path bends inward somewhere or has more than 512 segments. `a_line_from_one_circle_to_another_lands_on_their_common_tangent`, `a_line_from_a_turned_ellipse_lands_on_its_tangent_with_a_circle`, `a_line_near_the_second_path_takes_the_tangent_touching_it_nearest`, `a_line_keeps_its_start_without_a_tangent_snap`, `a_line_to_a_crescent_or_from_an_anchor_beside_the_curve_keeps_its_start` and `a_line_segment_drag_draws_the_common_tangent_as_one_undo_step` cover it.
|
||||
**Live trace result bounds and selection highlights exclude the retained bitmap except in source-image views:** `live_trace_result_bounds_exclude_the_retained_bitmap_at_any_angle` checks every TraceView, geometric and visual bounds and rotated result bounds. `live_trace_selection_highlight_excludes_the_retained_source_rectangle` checks result highlights and the existing ordinary-group policy. Shared editing-child traversal also preserves Shaper handling.
|
||||
|
||||
Reference in New Issue
Block a user