mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-29 01:34:29 +01:00
Dimension: Alt whole-path dimension measures the outside of the stroke with Use Preview Bounds
With Use Preview Bounds on, the box Alt shows over a path and the linear dimension of the whole path it places now reach the outside of the path's strokes, the width or height W and H show, instead of the outermost anchors. - The extent source records `preview: true` (omitted when false), so the dimension measures to the outside of the strokes again after later edits, a new stroke weight included. Files without it measure as before. - A member of a compound path is measured with the compound path's strokes and only the arrowheads the compound path draws on that member. Releasing the compound path or changing which member holds the first or last subpath measures it again. - The dimension line stays outside the stroke. - `dimension.create` takes `preview` on the extent source; a value other than true or false is an error. Geometry effects are not included.
This commit is contained in:
1 parent
4167e0abca
commit
23db97a4bd
6 files changed
+276
-51
No files matched your search
+105
-13
@@ -394,6 +394,11 @@ pub enum DimensionSource {
|
||||
/// it is vertical. Versions without this source do not open the file.
|
||||
Extent {
|
||||
node: NodeId,
|
||||
/// Placed with Use Preview Bounds on: the points are moved out to the outside of the
|
||||
/// strokes the path paints ([`preview_extents`]), the width or height that W and H show.
|
||||
/// Versions without it measure between the outermost points themselves.
|
||||
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
|
||||
preview: bool,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -402,7 +407,7 @@ impl DimensionSource {
|
||||
match self {
|
||||
Self::Segment { edge } | Self::Arc { edge } => vec![edge.node],
|
||||
Self::Angle { first, second } => vec![first.node, second.node],
|
||||
Self::Circle { node } | Self::Extent { node } => vec![*node],
|
||||
Self::Circle { node } | Self::Extent { node, .. } => vec![*node],
|
||||
Self::Points { a, b, vertex, free_a, free_b } => [a, b, vertex]
|
||||
.into_iter()
|
||||
.filter_map(|p| p.as_ref().map(|r| r.node))
|
||||
@@ -425,10 +430,18 @@ impl DimensionSource {
|
||||
})
|
||||
}
|
||||
/// Whether a path it measures differs between `before` and `after`, or is in only one of them.
|
||||
/// A node without a path, or missing from both, counts as changed.
|
||||
/// A node without a path, or missing from both, counts as changed. For a dimension of a whole
|
||||
/// path placed with Use Preview Bounds on, so does a change to the strokes the path paints
|
||||
/// ([`stroked_by`]): their appearance, the node they come from, or which arrowheads they draw
|
||||
/// on it.
|
||||
pub fn art_changed(&self, before: &Document, after: &Document) -> bool {
|
||||
let strokes = matches!(self, Self::Extent { preview: true, .. });
|
||||
self.nodes().into_iter().any(|id| match (before.node(id), after.node(id)) {
|
||||
(Some(old), Some(new)) => old.path_data().is_none() || (!std::ptr::eq(old, new) && old.path_data() != new.path_data()),
|
||||
(Some(old), Some(new)) => {
|
||||
old.path_data().is_none()
|
||||
|| (!std::ptr::eq(old, new) && old.path_data() != new.path_data())
|
||||
|| (strokes && stroked_by(before, id) != stroked_by(after, id))
|
||||
}
|
||||
_ => true,
|
||||
})
|
||||
}
|
||||
@@ -845,7 +858,9 @@ impl Dimension {
|
||||
let (a, b) = (self.a.to_vec2().dot(n), self.b.to_vec2().dot(n));
|
||||
let (low, high) = (a.min(b), a.max(b));
|
||||
match (doc, &self.source) {
|
||||
(Some(doc), Some(DimensionSource::Extent { node })) => reach(doc, *node, n).map_or((low, high), |(l, h)| (low.min(l), high.max(h))),
|
||||
(Some(doc), Some(DimensionSource::Extent { node, preview })) => {
|
||||
reach(doc, *node, n, *preview).map_or((low, high), |(l, h)| (low.min(l), high.max(h)))
|
||||
}
|
||||
_ => (low, high),
|
||||
}
|
||||
}
|
||||
@@ -891,8 +906,8 @@ impl Dimension {
|
||||
};
|
||||
}
|
||||
next.orientation = orientation;
|
||||
if let Some(DimensionSource::Extent { node }) = &next.source {
|
||||
(next.a, next.b) = extent(doc, *node, orientation == Orientation::Vertical).ok_or("Measured path no longer exists")?;
|
||||
if let Some(DimensionSource::Extent { node, preview }) = &next.source {
|
||||
(next.a, next.b) = extent(doc, *node, orientation == Orientation::Vertical, *preview).ok_or("Measured path no longer exists")?;
|
||||
}
|
||||
// Along the new normal, relative to the new first point, so that the result is the offset.
|
||||
let n = next.normal();
|
||||
@@ -1020,8 +1035,8 @@ impl Dimension {
|
||||
let (center, radius) = arc(doc, edge).ok_or("Choose a circle or a perfect arc")?;
|
||||
self.set_radial(center, radius);
|
||||
}
|
||||
Some(DimensionSource::Extent { node }) => {
|
||||
let (a, b) = extent(doc, *node, self.orientation == Orientation::Vertical).ok_or("Measured path no longer exists")?;
|
||||
Some(DimensionSource::Extent { node, preview }) => {
|
||||
let (a, b) = extent(doc, *node, self.orientation == Orientation::Vertical, *preview).ok_or("Measured path no longer exists")?;
|
||||
self.a = a;
|
||||
self.b = b;
|
||||
self.length = self.measured();
|
||||
@@ -1176,14 +1191,82 @@ fn same_extents(before: &Document, after: &Document, id: NodeId) -> bool {
|
||||
}
|
||||
|
||||
/// [`extents`] along one axis: the leftmost and the rightmost points, or with `vertical` the
|
||||
/// topmost and the bottommost.
|
||||
pub fn extent(doc: &Document, id: NodeId, vertical: bool) -> Option<(Point, Point)> {
|
||||
extents(doc, id).map(|ends| ends[usize::from(vertical)])
|
||||
/// topmost and the bottommost. With `preview`, the points of [`preview_extents`].
|
||||
pub fn extent(doc: &Document, id: NodeId, vertical: bool, preview: bool) -> Option<(Point, Point)> {
|
||||
let ends = if preview { preview_extents(doc, id) } else { extents(doc, id) };
|
||||
ends.map(|ends| ends[usize::from(vertical)])
|
||||
}
|
||||
|
||||
/// [`extents`] moved out to the box the path paints, its strokes included ([`painted_box`]), as Use
|
||||
/// Preview Bounds measures it: the leftmost and the rightmost points move out to that box's left
|
||||
/// and right sides at the same height, and the topmost and the bottommost to its top and bottom at
|
||||
/// the same place across. A path that paints no stroke keeps the points of [`extents`]. None for a
|
||||
/// node without a path or without segments.
|
||||
pub fn preview_extents(doc: &Document, id: NodeId) -> Option<[(Point, Point); 2]> {
|
||||
let [(left, right), (top, bottom)] = extents(doc, id)?;
|
||||
let Some(b) = painted_box(doc, id) else { return Some([(left, right), (top, bottom)]) };
|
||||
Some([
|
||||
(Point::new(left.x.min(b.x0), left.y), Point::new(right.x.max(b.x1), right.y)),
|
||||
(Point::new(top.x, top.y.min(b.y0)), Point::new(bottom.x, bottom.y.max(b.y1))),
|
||||
])
|
||||
}
|
||||
|
||||
/// The node whose strokes a path paints with: the compound path that holds it, or the path itself.
|
||||
fn painter(doc: &Document, id: NodeId) -> Option<&crate::Node> {
|
||||
let n = doc.node(id)?;
|
||||
match doc.parent_of(id).and_then(|p| doc.node(p)) {
|
||||
Some(c) if matches!(c.kind, crate::NodeKind::Compound { .. }) => Some(c),
|
||||
_ => Some(n),
|
||||
}
|
||||
}
|
||||
|
||||
/// What the strokes a path paints with depend on, besides its own shape: the node they come from
|
||||
/// ([`painter`]), its appearance, and which arrowheads they draw on the path ([`heads_on`]).
|
||||
fn stroked_by(doc: &Document, id: NodeId) -> Option<(NodeId, &crate::Appearance, (bool, bool))> {
|
||||
painter(doc, id).map(|p| (p.id, &*p.appearance, heads_on(p, id)))
|
||||
}
|
||||
|
||||
/// The box a path paints, its strokes included, measured along its own shape as
|
||||
/// [`crate::Node::visual_bounds`] measures a path: a member of a compound path is stroked with the
|
||||
/// compound path's strokes, with only the arrowheads the compound path paints on it. None for a
|
||||
/// node without a path or without anything drawn.
|
||||
fn painted_box(doc: &Document, id: NodeId) -> Option<vectorcraft_geom::Rect> {
|
||||
let n = doc.node(id)?;
|
||||
let path = n.path_data()?;
|
||||
let painter = painter(doc, id)?;
|
||||
let a = &painter.appearance;
|
||||
// A lone anchor is drawn only as the dot of a round or projecting cap on a closed subpath.
|
||||
let dots = a.painted_strokes().any(|s| matches!(s.cap, crate::LineCap::Round | crate::LineCap::Square));
|
||||
let b = path.drawn_bounds(dots).or_else(|| n.geometric_bounds())?;
|
||||
let (start, end) = heads_on(painter, id);
|
||||
let mut shape = None;
|
||||
Some(a.stroked_bounds_by(b, |s| {
|
||||
let bp = shape.get_or_insert_with(|| n.stroke_path().unwrap_or_default());
|
||||
if (s.start_arrow.is_some() && !start) || (s.end_arrow.is_some() && !end) {
|
||||
let mut s = s.clone();
|
||||
s.start_arrow = s.start_arrow.filter(|_| start);
|
||||
s.end_arrow = s.end_arrow.filter(|_| end);
|
||||
s.bounds_on(bp, b)
|
||||
} else {
|
||||
s.bounds_on(bp, b)
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
/// Whether the start and the end arrowheads of `painter`'s strokes can be drawn on its member
|
||||
/// `id`. A compound path's strokes put the start head on its first subpath and the end head on its
|
||||
/// last, so a member gets the start head only when it holds the first subpath with anchors and
|
||||
/// the end head only when it holds the last one. A path that is its own painter gets both.
|
||||
fn heads_on(painter: &crate::Node, id: NodeId) -> (bool, bool) {
|
||||
let Some(members) = painter.children().filter(|_| painter.id != id) else { return (true, true) };
|
||||
let drawn = |c: &&std::sync::Arc<crate::Node>| c.path_data().is_some_and(|p| p.subpaths.iter().any(|sp| !sp.anchors.is_empty()));
|
||||
(members.iter().find(drawn).is_some_and(|c| c.id == id), members.iter().rfind(drawn).is_some_and(|c| c.id == id))
|
||||
}
|
||||
|
||||
/// How far a path's outline reaches along the unit direction `u`: the lowest and the highest
|
||||
/// `p · u` over the points of its segments. None for a node without a path or without segments.
|
||||
pub fn reach(doc: &Document, id: NodeId, u: Vec2) -> Option<(f64, f64)> {
|
||||
/// `p · u` over the points of its segments, and with `preview` over the corners of the box it
|
||||
/// paints too ([`painted_box`]). None for a node without a path or without segments.
|
||||
pub fn reach(doc: &Document, id: NodeId, u: Vec2, preview: bool) -> Option<(f64, f64)> {
|
||||
use vectorcraft_geom::kurbo::{ParamCurve, ParamCurveExtrema};
|
||||
let path = doc.node(id)?.path_data()?;
|
||||
// Turns `u` onto the x axis, so the turned curve's extrema include those along `u`.
|
||||
@@ -1204,6 +1287,15 @@ pub fn reach(doc: &Document, id: NodeId, u: Vec2) -> Option<(f64, f64)> {
|
||||
}
|
||||
}
|
||||
}
|
||||
if preview
|
||||
&& let Some((low, high)) = span.as_mut()
|
||||
&& let Some(b) = painted_box(doc, id)
|
||||
{
|
||||
for corner in [Point::new(b.x0, b.y0), Point::new(b.x1, b.y0), Point::new(b.x1, b.y1), Point::new(b.x0, b.y1)] {
|
||||
let v = corner.to_vec2().dot(u);
|
||||
(*low, *high) = (low.min(v), high.max(v));
|
||||
}
|
||||
}
|
||||
span
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Create Dimension",
|
||||
[],
|
||||
None,
|
||||
"{mode?: linear|angular|radius|diameter, a?: [x,y], b?: [x,y], vertex?: [x,y], source?: {kind: segment, edge: {node,subpath,segment}}|{kind: angle, first: edge, second: edge}|{kind: circle, node}|{kind: arc, edge}|{kind: extent, node} (linear only: a whole path between its outermost points, leftmost and rightmost when horizontal or aligned, topmost and bottommost when vertical)|{kind: points, a?, b?, vertex?: {node,subpath,anchor}, freeA?, freeB?: a point that is not an anchor, {kind: onSegment, edge: {node,subpath,segment}, t: 0..1 (curve parameter)}|{kind: anchors, node, anchors: [{subpath,anchor,part?: point|in|out (the anchor, default, or its in or out handle),weight}] (2 or 3 points of one path whose weights add up to 1), across?: (2 anchors only: times the first-to-second anchor vector (x,y) turned to (-y,x), which points down when the vector points right)} (an end is an anchor or a free point, not both)}, orientation?: aligned|horizontal|vertical (linear only: the distance between the points, or only its horizontal or vertical part; default aligned), offset?: pt (the line's distance from the first point: along the left normal of a → b when aligned, downward when horizontal, leftward when vertical; negative goes the other way), options?: {units: in|mm|pt|pc|px|cm|m|ft|yd, precision: 0-6, scale: drawing:real, hideUnits, lineWeight, lineType: solid|dashed|dotted, lineColor: [r,g,b], arrowStyle: filled|open|tick|none, arrowHead: null|a built-in stroke.set arrowhead name (Barbed, LineArrow…; drawn at both ends in place of arrowStyle's head; versions that have the stroke arrowhead but do not read arrowHead draw arrowStyle when they draw the dimension again; custom arrowheads are refused), arrowScale: %, extensionWeight, extensionType, extensionColor, extensionOffset, extensionLength, hideExtensions, fontFamily, fontStyle, fontSize, textColor, textPosition: away|between, textAlignment: left|center|right, textOffset}} → {id,label}; linked measurements follow source edits",
|
||||
"{mode?: linear|angular|radius|diameter, a?: [x,y], b?: [x,y], vertex?: [x,y], source?: {kind: segment, edge: {node,subpath,segment}}|{kind: angle, first: edge, second: edge}|{kind: circle, node}|{kind: arc, edge}|{kind: extent, node, preview?: bool} (linear only: a whole path between its outermost points, leftmost and rightmost when horizontal or aligned, topmost and bottommost when vertical; preview, default false, moves them out to the outside of the path's strokes, as Use Preview Bounds measures)|{kind: points, a?, b?, vertex?: {node,subpath,anchor}, freeA?, freeB?: a point that is not an anchor, {kind: onSegment, edge: {node,subpath,segment}, t: 0..1 (curve parameter)}|{kind: anchors, node, anchors: [{subpath,anchor,part?: point|in|out (the anchor, default, or its in or out handle),weight}] (2 or 3 points of one path whose weights add up to 1), across?: (2 anchors only: times the first-to-second anchor vector (x,y) turned to (-y,x), which points down when the vector points right)} (an end is an anchor or a free point, not both)}, orientation?: aligned|horizontal|vertical (linear only: the distance between the points, or only its horizontal or vertical part; default aligned), offset?: pt (the line's distance from the first point: along the left normal of a → b when aligned, downward when horizontal, leftward when vertical; negative goes the other way), options?: {units: in|mm|pt|pc|px|cm|m|ft|yd, precision: 0-6, scale: drawing:real, hideUnits, lineWeight, lineType: solid|dashed|dotted, lineColor: [r,g,b], arrowStyle: filled|open|tick|none, arrowHead: null|a built-in stroke.set arrowhead name (Barbed, LineArrow…; drawn at both ends in place of arrowStyle's head; versions that have the stroke arrowhead but do not read arrowHead draw arrowStyle when they draw the dimension again; custom arrowheads are refused), arrowScale: %, extensionWeight, extensionType, extensionColor, extensionOffset, extensionLength, hideExtensions, fontFamily, fontStyle, fontSize, textColor, textPosition: away|between, textAlignment: left|center|right, textOffset}} → {id,label}; linked measurements follow source edits",
|
||||
has_doc,
|
||||
create
|
||||
),
|
||||
|
||||
@@ -542,6 +542,92 @@ fn a_dimension_of_a_whole_path_measures_its_overall_width_and_height() {
|
||||
assert!((value(&s, id) - across).abs() < 0.1, "{} against {across}", text(&s, id));
|
||||
}
|
||||
|
||||
/// A dimension of a whole path placed with Use Preview Bounds on (`"preview": true`) measures the
|
||||
/// outside of the stroke, the width or height W and H show, and follows a new stroke weight with
|
||||
/// its line as far outside the stroke as before. Without the flag the dimension measures between
|
||||
/// the outermost points. The flag survives a native file, and a value other than true or false is
|
||||
/// an error.
|
||||
#[test]
|
||||
fn a_dimension_of_a_whole_path_with_preview_bounds_measures_the_outside_of_the_stroke() {
|
||||
use vectorcraft_engine::doc::dimension::DimensionSource;
|
||||
let mut s = session();
|
||||
let rect = run(&mut s, "shape.rectangle", json!({"x":100,"y":100,"width":100,"height":60}))["id"].as_u64().unwrap();
|
||||
run(&mut s, "select.set", json!({"ids":[rect]}));
|
||||
run(&mut s, "stroke.set", json!({"weight": 10.0}));
|
||||
let create = |s: &mut Session, preview: bool, orientation: &str| {
|
||||
let source = json!({"kind":"extent","node":rect,"preview":preview});
|
||||
run(s, "dimension.create", json!({"source":source,"orientation":orientation,"offset":-30}))["id"].as_u64().unwrap()
|
||||
};
|
||||
let (wide, tall, plain) = (create(&mut s, true, "horizontal"), create(&mut s, true, "vertical"), create(&mut s, false, "horizontal"));
|
||||
let texts = |s: &Session| [wide, tall, plain].map(|id| text(s, id));
|
||||
assert_eq!(texts(&s), ["110.00 pt", "70.00 pt", "100.00 pt"]);
|
||||
// 30 pt above the first point, the top left anchor: 25 pt above the stroke.
|
||||
assert!((recipe(&s, wide).line_ends().0.y - 70.0).abs() < 1e-9, "{:?}", recipe(&s, wide).line_ends());
|
||||
run(&mut s, "select.set", json!({"ids":[rect]}));
|
||||
run(&mut s, "stroke.set", json!({"weight": 20.0}));
|
||||
assert_eq!(texts(&s), ["120.00 pt", "80.00 pt", "100.00 pt"]);
|
||||
assert!((recipe(&s, wide).line_ends().0.y - 65.0).abs() < 1e-9, "{:?}", recipe(&s, wide).line_ends());
|
||||
run(&mut s, "edit.undo", json!({}));
|
||||
assert_eq!(texts(&s), ["110.00 pt", "70.00 pt", "100.00 pt"]);
|
||||
|
||||
let saved = vectorcraft_format::save(&s.doc().unwrap().doc, false);
|
||||
let mut reopened = Session::new();
|
||||
reopened.add_document(vectorcraft_format::load(&saved).unwrap(), None);
|
||||
assert_eq!(recipe(&reopened, wide).source, Some(DimensionSource::Extent { node: NodeId(rect), preview: true }));
|
||||
assert_eq!(recipe(&reopened, plain).source, Some(DimensionSource::Extent { node: NodeId(rect), preview: false }));
|
||||
run(&mut reopened, "select.set", json!({"ids":[rect]}));
|
||||
run(&mut reopened, "stroke.set", json!({"weight": 2.0}));
|
||||
assert_eq!(texts(&reopened), ["102.00 pt", "62.00 pt", "100.00 pt"]);
|
||||
|
||||
let bad = json!({"source":{"kind":"extent","node":rect,"preview":"yes"},"orientation":"horizontal"});
|
||||
assert!(s.execute("dimension.create", &bad).is_err());
|
||||
}
|
||||
|
||||
/// With Use Preview Bounds, a dimension of a member of a compound path measures only the
|
||||
/// arrowheads the compound path draws on that member: the start head on the first member's line
|
||||
/// and the end head on the last one's. A member in the middle measures as the same line without
|
||||
/// arrowheads does.
|
||||
#[test]
|
||||
fn a_preview_bounds_dimension_of_a_compound_member_measures_only_its_own_arrowheads() {
|
||||
let mut s = session();
|
||||
let line = |s: &mut Session, y: f64| run(s, "shape.line", json!({"x1":100,"y1":y,"x2":200,"y2":y}))["id"].as_u64().unwrap();
|
||||
let (first, middle, last) = (line(&mut s, 100.0), line(&mut s, 200.0), line(&mut s, 300.0));
|
||||
run(&mut s, "select.set", json!({"ids":[first, middle, last]}));
|
||||
run(&mut s, "object.compoundPath.make", json!({}));
|
||||
run(&mut s, "stroke.set", json!({"weight": 4.0, "startArrow": "Triangle", "endArrow": "Triangle"}));
|
||||
let alone = line(&mut s, 400.0);
|
||||
run(&mut s, "select.set", json!({"ids":[alone]}));
|
||||
run(&mut s, "stroke.set", json!({"weight": 4.0}));
|
||||
let ends = |s: &mut Session, node: u64, orientation: &str| {
|
||||
let source = json!({"kind":"extent","node":node,"preview":true});
|
||||
let id = run(s, "dimension.create", json!({"source":source,"orientation":orientation,"offset":-30}))["id"].as_u64().unwrap();
|
||||
let (a, b) = (recipe(s, id).a, recipe(s, id).b);
|
||||
if orientation == "horizontal" { (a.x, b.x) } else { (a.y, b.y) }
|
||||
};
|
||||
let (bare, mid) = (ends(&mut s, alone, "horizontal"), ends(&mut s, middle, "horizontal"));
|
||||
assert!((mid.0 - bare.0).abs() < 1e-9 && (mid.1 - bare.1).abs() < 1e-9, "{mid:?} against {bare:?}");
|
||||
// Across the lines: the stroke weight alone, or wider where a head is drawn.
|
||||
let across = |s: &mut Session, node: u64| {
|
||||
let (a, b) = ends(s, node, "vertical");
|
||||
b - a
|
||||
};
|
||||
let bare = across(&mut s, alone);
|
||||
assert!((bare - 4.0).abs() < 1e-9, "{bare}");
|
||||
assert!((across(&mut s, middle) - bare).abs() < 1e-9, "{}", across(&mut s, middle));
|
||||
assert!(across(&mut s, first) > bare + 1.0, "start head on the first member: {}", across(&mut s, first));
|
||||
assert!(across(&mut s, last) > bare + 1.0, "end head on the last member: {}", across(&mut s, last));
|
||||
|
||||
// Released, the middle line draws both heads itself, and its dimension measures them.
|
||||
let source = json!({"kind":"extent","node":middle,"preview":true});
|
||||
let kept = run(&mut s, "dimension.create", json!({"source":source,"orientation":"vertical","offset":-30}))["id"].as_u64().unwrap();
|
||||
let span = |s: &Session| recipe(s, kept).b.y - recipe(s, kept).a.y;
|
||||
assert!((span(&s) - bare).abs() < 1e-9, "{}", span(&s));
|
||||
let compound = s.doc().unwrap().doc.parent_of(NodeId(middle)).unwrap();
|
||||
run(&mut s, "select.set", json!({"ids":[compound.0]}));
|
||||
run(&mut s, "object.compoundPath.release", json!({}));
|
||||
assert!(span(&s) > bare + 1.0, "{}", span(&s));
|
||||
}
|
||||
|
||||
/// A dimension of a whole path measures the segments the path draws: an anchor that starts no
|
||||
/// segment does not widen it. Its line stays clear of the whole path when only parts other than
|
||||
/// its measured points move, also when it is aligned or is scaled together with the path, when the
|
||||
|
||||
@@ -41,28 +41,38 @@ impl Kind {
|
||||
}
|
||||
}
|
||||
|
||||
/// What the pointer is over. `Extent` is a path hovered with Alt held: its overall width or height.
|
||||
/// What the pointer is over. `Extent` is a path hovered with Alt held: its overall width or height,
|
||||
/// with `preview` (Use Preview Bounds on) to the outside of its strokes.
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
enum Target {
|
||||
Segment(SegmentRef),
|
||||
Corner { first: SegmentRef, second: SegmentRef, at: Point },
|
||||
Radial { source: DimensionSource, center: Point, radius: f64 },
|
||||
Extent { node: NodeId },
|
||||
Extent { node: NodeId, preview: bool },
|
||||
}
|
||||
|
||||
/// A path and the document its outermost points ([`dimension::extents`]) were read from
|
||||
/// ([`whole_box_source`]), with the points.
|
||||
type WholeBox = ((NodeId, (u64, u64, usize)), Option<[(Point, Point); 2]>);
|
||||
/// A path, whether its points are moved out to its strokes, and the document its outermost points
|
||||
/// ([`whole_ends`]) were read from ([`whole_box_source`]).
|
||||
type WholeBoxKey = (NodeId, bool, (u64, u64, usize));
|
||||
|
||||
/// The key of a path's outermost points ([`WholeBoxKey`]), with the points.
|
||||
type WholeBox = (WholeBoxKey, Option<[(Point, Point); 2]>);
|
||||
|
||||
/// The document a path's box is read from, with what identifies it: while an interaction is in
|
||||
/// progress, the document as it began; otherwise the document `cx` shows, at its revision.
|
||||
fn whole_box_source<'a>(cx: &ToolContext<'a>, node: NodeId) -> (&'a vectorcraft_doc::Document, (NodeId, (u64, u64, usize))) {
|
||||
fn whole_box_source<'a>(cx: &ToolContext<'a>, node: NodeId, preview: bool) -> (&'a vectorcraft_doc::Document, WholeBoxKey) {
|
||||
match cx.interaction_doc {
|
||||
Some(began) => (began, (node, (cx.revision.0, 0, std::ptr::from_ref(began).addr()))),
|
||||
None => (cx.doc, (node, (cx.revision.0, cx.revision.1, 0))),
|
||||
Some(began) => (began, (node, preview, (cx.revision.0, 0, std::ptr::from_ref(began).addr()))),
|
||||
None => (cx.doc, (node, preview, (cx.revision.0, cx.revision.1, 0))),
|
||||
}
|
||||
}
|
||||
|
||||
/// The outermost points a dimension of the whole path `node` measures: [`dimension::extents`], or
|
||||
/// with `preview` [`dimension::preview_extents`], moved out to the outside of the path's strokes.
|
||||
fn whole_ends(doc: &vectorcraft_doc::Document, node: NodeId, preview: bool) -> Option<[(Point, Point); 2]> {
|
||||
if preview { dimension::preview_extents(doc, node) } else { dimension::extents(doc, node) }
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct DimensionTool {
|
||||
kind: Kind,
|
||||
@@ -165,8 +175,7 @@ fn orientation_at(a: Point, b: Point, p: Point) -> Orientation {
|
||||
.map_or(Orientation::Aligned, |(_, orientation)| orientation)
|
||||
}
|
||||
|
||||
/// The box through a path's outermost points ([`dimension::extents`]): left, top, right and
|
||||
/// bottom.
|
||||
/// The box through a path's outermost points ([`whole_ends`]): left, top, right and bottom.
|
||||
fn extent_box([(left, right), (top, bottom)]: [(Point, Point); 2]) -> Rect {
|
||||
Rect::new(left.x, top.y, right.x, bottom.y)
|
||||
}
|
||||
@@ -1032,27 +1041,27 @@ impl DimensionTool {
|
||||
};
|
||||
Some(now.or(self.first_pick).unwrap_or(*at))
|
||||
}
|
||||
/// The outermost points of `node` ([`dimension::extents`]), read again only when the path or
|
||||
/// the document changes. While an interaction is in progress they are read from the document
|
||||
/// as the interaction began, which each preview starts again from (as the levels in
|
||||
/// The outermost points of `node` ([`whole_ends`]), read again only when the path or the
|
||||
/// document changes. While an interaction is in progress they are read from the document as
|
||||
/// the interaction began, which each preview starts again from (as the levels in
|
||||
/// [`Self::preview`] are), so the previews themselves do not make the tool read the path again.
|
||||
fn whole_box(&mut self, cx: &ToolContext, node: NodeId) -> Option<[(Point, Point); 2]> {
|
||||
let (from, key) = whole_box_source(cx, node);
|
||||
fn whole_box(&mut self, cx: &ToolContext, node: NodeId, preview: bool) -> Option<[(Point, Point); 2]> {
|
||||
let (from, key) = whole_box_source(cx, node, preview);
|
||||
if let Some((kept, ends)) = self.whole_box
|
||||
&& kept == key
|
||||
{
|
||||
return ends;
|
||||
}
|
||||
let ends = dimension::extents(from, node);
|
||||
let ends = whole_ends(from, node, preview);
|
||||
self.whole_box = Some((key, ends));
|
||||
ends
|
||||
}
|
||||
/// What the pointer at `p` is over. A Linear path hovered with `alt` held, before any point
|
||||
/// is picked, is the whole path.
|
||||
/// is picked, is the whole path: with Use Preview Bounds on, to the outside of its strokes.
|
||||
fn target(&self, cx: &ToolContext, p: Point, alt: bool) -> Option<Target> {
|
||||
let edge = pick(cx, p)?;
|
||||
match self.kind {
|
||||
Kind::Linear if alt && self.points.is_empty() => Some(Target::Extent { node: edge.node }),
|
||||
Kind::Linear if alt && self.points.is_empty() => Some(Target::Extent { node: edge.node, preview: cx.preview_bounds }),
|
||||
Kind::Linear => Some(Target::Segment(edge)),
|
||||
Kind::Angular => {
|
||||
let (anchor, at) = anchor_near(cx, &edge, p)?;
|
||||
@@ -1104,9 +1113,9 @@ impl DimensionTool {
|
||||
let mode = if p.distance(*center) >= *radius { DimensionMode::Radius } else { DimensionMode::Diameter };
|
||||
self.recipe(mode, *center, p, Point::ZERO, Some(source.clone()))
|
||||
}
|
||||
Target::Extent { node } => {
|
||||
let mut d =
|
||||
self.recipe(DimensionMode::Linear, Point::ZERO, Point::new(1.0, 0.0), Point::ZERO, Some(DimensionSource::Extent { node: *node }));
|
||||
Target::Extent { node, preview } => {
|
||||
let source = DimensionSource::Extent { node: *node, preview: *preview };
|
||||
let mut d = self.recipe(DimensionMode::Linear, Point::ZERO, Point::new(1.0, 0.0), Point::ZERO, Some(source));
|
||||
d.orientation = Orientation::Horizontal;
|
||||
d
|
||||
}
|
||||
@@ -1130,7 +1139,7 @@ impl DimensionTool {
|
||||
}
|
||||
self.level_guide = None;
|
||||
let whole = match self.pending.as_ref().and_then(|d| d.source.as_ref()) {
|
||||
Some(DimensionSource::Extent { node }) => Some(self.whole_box(cx, *node)),
|
||||
Some(DimensionSource::Extent { node, preview }) => Some(self.whole_box(cx, *node, *preview)),
|
||||
_ => None,
|
||||
};
|
||||
let Some(d) = &mut self.pending else { return vec![] };
|
||||
@@ -1399,8 +1408,8 @@ impl Tool for DimensionTool {
|
||||
}
|
||||
self.hover = self.target(cx, ev.pos, ev.mods.alt);
|
||||
let whole = match self.hover {
|
||||
Some(Target::Extent { node }) => {
|
||||
self.whole_box(cx, node);
|
||||
Some(Target::Extent { node, preview }) => {
|
||||
self.whole_box(cx, node, preview);
|
||||
true
|
||||
}
|
||||
_ => false,
|
||||
@@ -1553,14 +1562,15 @@ impl Tool for DimensionTool {
|
||||
out.push(Overlay::Line { a: *center, b: *center + toward / toward.hypot() * *radius, color, dashed: true });
|
||||
}
|
||||
}
|
||||
Some(Target::Extent { node }) => {
|
||||
// The box through the path's outermost points: a Smart Guide, or with Smart
|
||||
// Guides off a line in the tool's own color.
|
||||
// Read again when the path changed since the pointer last moved.
|
||||
let (from, at) = whole_box_source(cx, *node);
|
||||
Some(Target::Extent { node, preview }) => {
|
||||
// The box through the path's outermost points (with Use Preview Bounds on, out
|
||||
// to its strokes): a Smart Guide, or with Smart Guides off a line in the
|
||||
// tool's own color. Read again when the path changed since the pointer last
|
||||
// moved.
|
||||
let (from, at) = whole_box_source(cx, *node, *preview);
|
||||
let b = match self.whole_box {
|
||||
Some((key, ends)) if key == at => ends,
|
||||
_ => dimension::extents(from, *node),
|
||||
_ => whole_ends(from, *node, *preview),
|
||||
}
|
||||
.map(extent_box);
|
||||
if let Some(b) = b {
|
||||
@@ -2880,7 +2890,7 @@ mod tests {
|
||||
};
|
||||
let mut t = DimensionTool::default();
|
||||
t.pointer(&c, &held(PointerKind::Move, 150.0, 100.0));
|
||||
assert_eq!(t.hover, Some(Target::Extent { node: id }));
|
||||
assert_eq!(t.hover, Some(Target::Extent { node: id, preview: false }));
|
||||
assert!(t.overlays(&c).iter().any(|o| matches!(o, Overlay::Line { color, .. } if *color == c.smart_guide_color)));
|
||||
// With Smart Guides off the box is not a Smart Guide, and at a high zoom the size stays by
|
||||
// the pointer.
|
||||
@@ -2944,6 +2954,34 @@ mod tests {
|
||||
assert!(o.iter().any(near), "{o:?}");
|
||||
}
|
||||
|
||||
/// With Use Preview Bounds on, the box Alt shows over a stroked path reaches the outside of its
|
||||
/// stroke, and the dimension of the whole path it places measures to there, as W and H do; it
|
||||
/// keeps doing so after the art changes (`"preview": true`). With the preference off, the box
|
||||
/// and the dimension go through the outermost points.
|
||||
#[test]
|
||||
fn with_preview_bounds_an_alt_placed_dimension_measures_the_outside_of_the_stroke() {
|
||||
let (d, id) = doc_with_rect();
|
||||
let (s, p) = (Selection::default(), paint());
|
||||
let held = |kind, x: f64, y: f64| PointerEvent::new(kind, x, y).with_mods(Mods { alt: true, ..Mods::default() });
|
||||
let near = |a: f64, b: f64| (a - b).abs() < 1e-9;
|
||||
for (preview, (left, right)) in [(true, (99.5, 200.5)), (false, (100.0, 200.0))] {
|
||||
let c = ToolContext { preview_bounds: preview, ..cx(&d, &s, &p) };
|
||||
let mut t = DimensionTool::default();
|
||||
t.pointer(&c, &held(PointerKind::Move, 150.0, 100.0));
|
||||
assert_eq!(t.hover, Some(Target::Extent { node: id, preview }));
|
||||
let xs: Vec<f64> = t.overlays(&c).iter().filter_map(|o| if let Overlay::Line { a, .. } = o { Some(a.x) } else { None }).collect();
|
||||
assert!(xs.iter().any(|x| near(*x, left)) && xs.iter().any(|x| near(*x, right)), "preview {preview}: {xs:?}");
|
||||
t.pointer(&c, &held(PointerKind::Down, 150.0, 100.0));
|
||||
t.pointer(&c, &held(PointerKind::Up, 150.0, 100.0));
|
||||
let acts = t.pointer(&c, &PointerEvent::new(PointerKind::Move, 150.0, 60.0));
|
||||
let Some(Action::Preview(_, params)) = acts.last() else { panic!("{acts:?}") };
|
||||
let source = if preview { json!({"kind":"extent","node":id,"preview":true}) } else { json!({"kind":"extent","node":id}) };
|
||||
assert_eq!(params["source"], source);
|
||||
let (a, b) = (params["a"][0].as_f64().unwrap_or(f64::NAN), params["b"][0].as_f64().unwrap_or(f64::NAN));
|
||||
assert!(near(a, left) && near(b, right), "preview {preview}: {a} to {b}");
|
||||
}
|
||||
}
|
||||
|
||||
/// A point that Smart Guides leave where the pointer already is (the pointer right in line
|
||||
/// with a target) stays on the guide the overlays show. It does not move to the nearest point
|
||||
/// of a segment within the pick's reach. Off the guides, a point near a segment still lands
|
||||
|
||||
+14
-5
@@ -105,7 +105,12 @@ The **Dimension Tool** is in the Modify section of the toolbar. Its strip offers
|
||||
that starts no segment is left out. They are read again whenever the path changes, so a turned
|
||||
path shows its new overall width or height rather than that of its bounding box before the
|
||||
turn. The line keeps its distance from the whole path when the path changes or the dimension
|
||||
changes orientation. Alt has this effect only before the first point is clicked.
|
||||
changes orientation. With Use Preview Bounds on, the box and the dimension reach the outside of
|
||||
the path's strokes, the width or height that W and H show: each outermost point moves out to the
|
||||
edge of the box the strokes paint (a member of a compound path takes the compound path's
|
||||
strokes, with an arrowhead only where the compound path draws one on that member), and a dimension placed that way measures to there again when the path or its strokes
|
||||
change. Geometry effects are not included. Alt has this effect only before the first point is
|
||||
clicked.
|
||||
- **Angular:** hover a corner where two straight segments meet and drag outwards. Or click two
|
||||
straight lines that meet (or would, extended), then click to place.
|
||||
- **Radial:** hover a circle, or a segment that is a perfect arc, and drag: outwards gives its
|
||||
@@ -199,10 +204,14 @@ another document.
|
||||
mode, the orientation of a linear dimension (`aligned`, the default, `horizontal` or
|
||||
`vertical`), offset and style; returns the group id and label. `{"kind":"extent","node":<id>}`
|
||||
measures a whole path, linear only: between its leftmost and rightmost points when horizontal
|
||||
or aligned, and its topmost and bottommost points when vertical. A version without the extent
|
||||
source does not open a file that holds one. `offset` is the distance of the dimension
|
||||
line from the first point: along the left normal of a → b for an aligned dimension, downward
|
||||
for a horizontal one and leftward for a vertical one. A negative offset goes the other way.
|
||||
or aligned, and its topmost and bottommost points when vertical. With `"preview":true` (what
|
||||
the tool records with Use Preview Bounds on; `false` when omitted, and any value other than
|
||||
`true` or `false` is an error) those points move out to the outside of the path's strokes. A
|
||||
version without the extent source does not open a file that holds one, and a version without
|
||||
`preview` measures such a dimension between the points themselves. `offset` is the distance of
|
||||
the dimension line from the first point: along the left normal of a → b for an aligned
|
||||
dimension, downward for a horizontal one and leftward for a vertical one. A negative offset goes
|
||||
the other way.
|
||||
- `dimension.update`: restyle or move existing dimensions, or change the orientation of linear
|
||||
ones. A new orientation keeps the line on the side of the points it was on. For a dimension of
|
||||
a whole path, a new orientation that would put the line more than 1,000,000 pt from its first
|
||||
|
||||
@@ -740,7 +740,7 @@ since 2026-10-01.
|
||||
**Drawing tools, Ellipse tool circle from its center sized to touch a path:** By VectorCraft's own rule, with Smart Guides and Snap to Tangent on, a circle drawn from its center (Alt and Shift) snaps its radius so that the circle touches a nearby path whenever the radius comes within the snapping tolerance of that size. The touch point is where the line from the center meets a straight segment or a curve square, inside a segment or at an anchor where the path runs smoothly, also where a curve's handle lies on that anchor. A circle can touch another circle from outside or touch it from inside, and a center inside a closed path gives a circle that touches the path from within. A corner or an open path's end is not offered, nor a curve around the same center. The touch point shows the "tangent" label and the line from the center as guides; the radius is measured along the Constrain Angle's axes, as the drawn box is, and Space moves the circle at the size it snapped to, which it keeps when Space is let go. The snap does not apply to an ellipse (no Shift). When an anchor, center or crossing is within the snapping tolerance of the pointer, or the dragged corner snapped onto one, the circle is not resized to touch a path. Snap to Grid and pixel snapping place the drawn point instead, also when turned on during the drag, and turning Snap to Tangent off during the drag stops the snap. A press with a small jitter is still a click rather than a drag. At most 256 segments near that radius are measured per pointer move, the ones nearest the pointer. `a_circle_from_its_center_snaps_its_radius_to_touch_a_line`, `a_circle_from_its_center_snaps_to_touch_another_circle_from_outside_and_inside`, `a_circle_from_its_center_snaps_to_touch_a_curve`, `a_circle_from_its_center_keeps_its_radius_without_the_snap_or_a_smooth_touch`, `a_circle_from_its_center_prefers_an_anchor_and_measures_the_segments_nearest_the_pointer`, `a_circle_snapped_to_touch_keeps_to_the_constrain_angle`, `a_circle_from_its_center_does_not_snap_to_touch_with_the_grid_or_pixels`, `a_jittered_alt_shift_press_beside_a_path_is_a_click`, `a_circle_from_its_center_prefers_an_anchor_or_a_crossing_at_the_pointer` and `a_circle_from_its_center_touches_a_path_at_an_anchor_with_retracted_handles` cover it.
|
||||
**Drawing tools, selected Dimension extension-line style (#7078):** Properties › Dimension exposes the selected editable dimension's existing extension-line color and weight. Both extension lines share that style, independently of the main dimension line and label. Apply to All keeps its full-style behavior for editable dimensions, leaving a protected dimension unchanged; Set as Default keeps the whole style for a new dimension created without explicit options, without changing existing dimensions. The dimension remains editable. Four cases in `crates/ui-egui/tests/dimension_extension_properties.rs` verify actual Properties input, both canvas extension lines, independent main-line/label styling, full-style Apply to All, locked and unselected controls, defaults/new dimensions, Undo/Redo, and native save/reopen with further editing. Existing document-color conversion is unchanged. The measured geometry and existing snapping behavior are unchanged; no whole-Dimension completion or score/hour change is claimed.
|
||||
**Drawing tools, Dimension tool horizontal and vertical linear dimensions:** A linear dimension between two clicked points or dragged out from a segment is aligned, horizontal or vertical, chosen by where the pointer moves while it is placed, and a click again by the second point gives aligned; `dimension.create` and `dimension.update` take `orientation`, and the dimension stays linked to the anchors it measures, keeps its orientation when it or the art turns, with a line that lay outside the points kept outside them; an unlinked horizontal or vertical dimension that is reflected has its line on the reflected side. `the_pointer_chooses_aligned_horizontal_or_vertical`, `two_points_measure_horizontally_vertically_or_aligned`, `clicking_again_by_the_second_point_places_an_aligned_dimension`, `a_segment_drag_measures_horizontally_vertically_or_aligned`, `points_on_a_vertical_line_measure_aligned`, `horizontal_and_vertical_dimensions_draw_lines_along_their_axis`, `turned_horizontal_dimensions_stay_horizontal`, `a_linked_horizontal_dimension_keeps_its_gap_from_turned_art`, `a_linked_horizontal_dimension_below_or_between_its_points_follows_turned_art`, `a_reflected_horizontal_dimension_keeps_its_line_on_the_reflected_side`, `a_dimension_without_an_orientation_reads_as_aligned`, `dimension_orientation_is_checked` and `a_turned_dimension_keeps_its_line_on_its_side` cover it.
|
||||
**Drawing tools, Dimension tool overall width and height of a path:** The [linear dimensions help](https://helpx.adobe.com/illustrator/desktop/measure-and-align/plot-and-measure/plot-linear-dimensions-of-objects.html) describes plotting an object's horizontal and vertical dimensions with Alt (Option on macOS) held over its path. By VectorCraft's own rule, hovering a path with Alt held shows a box through its outermost points (a Smart Guide when Smart Guides are on); a click then a placing click, or a drag out from the path, places a linear dimension of the whole path, and the pointer above or below the path gives its width and beside it its height. `dimension.create` takes the `extent` source, whose points are the outermost points of the path's curves, read again after every edit, so a turned path shows its new overall size, and the line keeps its distance from the whole path. `an_alt_click_or_drag_on_a_path_places_its_overall_width_or_height`, `a_dimension_of_a_whole_path_measures_its_overall_width_and_height`, `a_dimension_of_a_whole_path_stays_clear_of_the_path_it_draws` and `a_dimension_of_a_whole_path_survives_a_native_file` cover it.
|
||||
**Drawing tools, Dimension tool overall width and height of a path:** The [linear dimensions help](https://helpx.adobe.com/illustrator/desktop/measure-and-align/plot-and-measure/plot-linear-dimensions-of-objects.html) describes plotting an object's horizontal and vertical dimensions with Alt (Option on macOS) held over its path. By VectorCraft's own rule, hovering a path with Alt held shows a box through its outermost points (a Smart Guide when Smart Guides are on); a click then a placing click, or a drag out from the path, places a linear dimension of the whole path, and the pointer above or below the path gives its width and beside it its height. `dimension.create` takes the `extent` source, whose points are the outermost points of the path's curves, read again after every edit, so a turned path shows its new overall size, and the line keeps its distance from the whole path. With Use Preview Bounds on, the box and the dimension reach the outside of the path's strokes, the size W and H show, and the source records `"preview":true` so the dimension measures to there after later edits, a new stroke weight included. `an_alt_click_or_drag_on_a_path_places_its_overall_width_or_height`, `with_preview_bounds_an_alt_placed_dimension_measures_the_outside_of_the_stroke`, `a_dimension_of_a_whole_path_measures_its_overall_width_and_height`, `a_dimension_of_a_whole_path_with_preview_bounds_measures_the_outside_of_the_stroke`, `a_dimension_of_a_whole_path_stays_clear_of_the_path_it_draws` and `a_dimension_of_a_whole_path_survives_a_native_file` cover it.
|
||||
**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.
|
||||
|
||||
Reference in new issue
Block a user