diff --git a/ASSETS.md b/ASSETS.md
index faf29e86be..2812067e00 100644
--- a/ASSETS.md
+++ b/ASSETS.md
@@ -115,6 +115,7 @@ Generated-in-code art is original and has no file to list. This covers the defau
| `assets/icons/dc-anchor-smooth.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-appearance.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-arc.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
+| `assets/icons/dc-arc-three-point.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | The Three-Point Arc tool: an arc through its two ends and a third point |
| `assets/icons/dc-arrow-down.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-arrow-extend.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-arrow-fill.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | The Selection and Direct Selection arrows' fill, painted black or white under their outline |
diff --git a/ROADMAP.md b/ROADMAP.md
index c4a6edc8fb..51cb3af258 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -162,6 +162,7 @@ Ranked; detail in [docs/roadmap.md](docs/roadmap.md) and [docs/gaps.md](docs/gap
- 2026-11-17: Tangent Circle Tool joins the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools, and the All Tools drawer): click a path segment, then another, to draw the circle tangent to the first where it was clicked that touches the second; Shift uses the tool's radius and a drag from the second segment sets the radius (Shift in round steps, Cmd/Ctrl slowly), the circle then touching the first segment anywhere along it. The circle shows with its center and radii before the click, one undo step (`tangentCircle`). A VectorCraft addition: headline numbers unchanged.
- 2026-11-18: Common Tangents also takes a point (a path of one anchor) and a convex closed path: the lines from the point that touch the path, and the line from the point to the path's center if asked; a point on the outline gets the one tangent there, and a point inside gets none, with a message (#7846). A VectorCraft addition: headline numbers unchanged.
- 2026-11-15: With Smart Guides and Snap to Tangent on, a Line Segment drag pressed on one convex curved path and dragged near another lands on a common tangent of the two: both ends move to where the line touches the paths, each labeled "tangent" (#7845). A VectorCraft addition: headline numbers unchanged.
+- 2026-11-17: Three-Point Arc tool, in the Line Segment tool's group after the Arc tool: two ends placed by a drag or two clicks, then a third point the open circular arc passes through, or with Third Point Sets Direction (Tool Options, or `]` while drawing) the direction the arc leaves an end in; it previews the arc, its center and, with Measurement Labels on, its radius, and draws it in one undo step (`shape.threePointArc`). Points with no arc are refused with a message. A VectorCraft addition: headline numbers unchanged.
- 2026-11-15: Smooth Bridge joins the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools): two selected circles become one closed outline joined by two concave arcs that touch both circles, so every anchor is smooth; the arcs' radius is a percentage of the smaller circle's radius (1 to 1000%, 100% by default), and Keep Originals adds the outline above the circles instead of replacing them. A dialog with Preview, one undo step (`addon.pathtools.bridge`). A VectorCraft addition: headline numbers unchanged.
- 2026-11-18: Smooth Bridge also joins three or more circles: every two whose outlines are within Reach (10 pt by default) are joined, the bridges that connect become one shape each, and a circle bridged to no other stays as it is (at most 2000 circles); with Constant Gap the arcs' radius is the smaller circle's radius plus a gap (#8030). A VectorCraft addition: headline numbers unchanged.
- 2026-11-03: Text Tweaker, the first tool of the Type Tools add-on (Object › Plug-ins › Type Tools): one character attribute (size, baseline shift, rotation, horizontal or vertical scale, tracking, leading or stroke weight) goes letter by letter from a start value to an end value along a straight ramp, an ease, a bow, a spike or at random with a seed, set as the Character panel sets it, while the text stays live; a dialog with Preview, one undo step (`addon.type.textTweaker`, #4924). A VectorCraft addition: headline numbers unchanged.
diff --git a/assets/icons/dc-arc-three-point.svg b/assets/icons/dc-arc-three-point.svg
new file mode 100644
index 0000000000..479a9a5930
--- /dev/null
+++ b/assets/icons/dc-arc-three-point.svg
@@ -0,0 +1 @@
+
diff --git a/crates/engine/src/cmd/create.rs b/crates/engine/src/cmd/create.rs
index 89752c1b33..f012bcfc82 100644
--- a/crates/engine/src/cmd/create.rs
+++ b/crates/engine/src/cmd/create.rs
@@ -105,6 +105,15 @@ pub fn specs() -> Vec {
has_doc,
arc
),
+ cmd!(
+ "shape.threePointArc",
+ "Three-Point Arc",
+ [],
+ None,
+ "{start: [x, y], end: [x, y], through?: [x, y], toward?: [x, y], at?: \"start\"|\"end\" (default \"start\"; only with `toward`)} → {id, cx, cy, radius, sweep}: an open circular arc from `start` to `end` in the current stroke (black when it is none) with no fill, its ends exactly at the two points (not pixel-aligned). With `through`, the arc passes through that point, an anchor of the path; with `toward`, it leaves the end `at` names heading toward that point (its tangent there). Give exactly one of `through` and `toward`; `at` with `through` is an error. `sweep` is the arc's turn in degrees, positive clockwise on the page. Two points that are the same, three on one line, or an arc reaching past the canvas are an error, and nothing is drawn",
+ has_doc,
+ three_point_arc
+ ),
cmd!(
"shape.rectangularGrid",
"Rectangular Grid",
@@ -680,6 +689,50 @@ fn arc(s: &mut Session, p: &Value) -> Result {
insert_look_turned(s, "Arc", path_kind(path, None), look, None, true, bbox_angle, true)
}
+/// An open circular arc from `start` to `end` ([`shapes::CircularArc`]): through `through`, or
+/// leaving the end `at` names toward `toward`. One undo step, named as an Arc tool drag is.
+fn three_point_arc(s: &mut Session, p: &Value) -> Result {
+ const C: &str = "shape.threePointArc";
+ let point = |key: &str| finite_numbers::<2>(&p[key]).map(|[x, y]| Point::new(x, y)).ok_or_else(|| bad(C, format!("`{key}` must be [x, y]")));
+ let (start, end) = (point("start")?, point("end")?);
+ let from_end = match p.get("at") {
+ None => false,
+ Some(Value::String(v)) if v == "start" || v == "end" => v == "end",
+ Some(_) => return Err(bad(C, "`at` must be \"start\" or \"end\"")),
+ };
+ // The arc, and the point it passes through (an anchor of the path, so the path meets it exactly).
+ let (arc, via) = match (p.get("through"), p.get("toward")) {
+ (Some(_), None) if p.get("at").is_some() => return Err(bad(C, "give `at` only with `toward`")),
+ (Some(_), None) => {
+ let through = point("through")?;
+ (shapes::CircularArc::through(start, end, through), Some(through))
+ }
+ (None, Some(_)) if from_end => {
+ let toward = point("toward")?;
+ (shapes::CircularArc::arriving(start, end, end - toward), None)
+ }
+ (None, Some(_)) => {
+ let toward = point("toward")?;
+ (shapes::CircularArc::leaving(start, toward - start, end), None)
+ }
+ _ => return Err(bad(C, "give exactly one of `through` and `toward`")),
+ };
+ let arc = arc.ok_or_else(|| bad(C, "no arc fits these points: two are the same or all three lie on one line"))?;
+ let path = via.map_or_else(|| arc.to_path(), |v| arc.to_path_via(v));
+ let look = s.new_art_look(
+ vectorcraft_color::Paint::None,
+ if s.paint.stroke.is_none() { vectorcraft_color::Paint::solid(vectorcraft_color::Color::BLACK) } else { s.paint.stroke.clone() },
+ s.paint.stroke_width.max(0.1),
+ );
+ // Not pixel-aligned: the ends stay on the given points.
+ let mut out = insert_look_turned(s, "Arc", path_kind(path, None), look, None, true, 0.0, false)?;
+ out["cx"] = json!(arc.center.x);
+ out["cy"] = json!(arc.center.y);
+ out["radius"] = json!(arc.radius);
+ out["sweep"] = json!(arc.sweep.to_degrees());
+ Ok(out)
+}
+
/// The grid `paths` (bottom first) as one selected group in the new-art stroke, filled with the
/// current fill when `fill`; a path of several subpaths becomes a compound path of them. The group
/// and its members get the bounding-box angle `bbox_angle` (a grid drawn along a Constrain Angle).
diff --git a/crates/engine/src/cmd/gradient.rs b/crates/engine/src/cmd/gradient.rs
index 746749235b..f5270c9780 100644
--- a/crates/engine/src/cmd/gradient.rs
+++ b/crates/engine/src/cmd/gradient.rs
@@ -24,7 +24,7 @@ pub fn specs() -> Vec {
"Gradient",
["Window", "Gradient"],
None,
- "{stroke?: bool (default: the targeted item's kind, else the active proxy), kind?: linear|radial|conic|diamond|freeform (conic, also accepted as angle or conical, sweeps the stops once around the center, clockwise from the vector, with a seam where the last stop meets the first; diamond runs the stops from the center out to a square with a corner at the end of the vector; freeform places points on each object, coloured along the stops), mode?: points|lines (freeform: how the Gradient tool adds points), method?: classic|perceptual|hue-clockwise|hue-counterclockwise (how the colours between the stops mix: in display RGB, perceptually (OKLab) so the steps look even, or around the hue wheel: hue, saturation and brightness each change evenly from one stop to the next, the hue angle falling with hue-clockwise (red, magenta, blue, cyan, green, yellow) and rising with hue-counterclockwise; two stops whose hues are less than half a color level apart keep that hue; a stop whose RGB numbers are less than half a color level apart is gray and takes the hue of the stop it mixes with, and black that stop's saturation too; these two methods are VectorCraft's own, and SVG and PDF exports draw their gradients as RGB images, CMYK and spot color stops included; SVG exports draw a Perceptual gradient as an image, and PDF exports do too unless it is linear, radial, conic or diamond, has spot color stops, every other stop is paper white or written in CMYK or gray (an export that converts colors to a CMYK destination profile writes RGB and Lab stops in CMYK, and so does a CMYK document unless the export converts colors to an RGB destination profile), it is not a dithered fill and its curve does not have too many stops: then PDF writes tints of one spot ink as a Separation shading in that ink, and spot inks mixed with other spot, CMYK or gray inks as a DeviceN shading; freeform gradients mix their own way), spread?: pad|repeat|reflect (linear, radial, conic and diamond: what the gradient paints past the ends of its stops: pad carries the end colors on; repeat and reflect run the stops `repeats` times along the vector (around the circle, for a conic) and on past both ends, reflect mirroring every other run; an error on a freeform gradient), repeats?: 1..100 (a whole number: how many times repeat and reflect run the stops along the vector; VectorCraft's own limit; pad keeps it unused), stops?: [{offset 0..1, color? (needed without swatch; #rrggbbaa and #rgba are refused), opacity? 0..1 (or 0..100), midpoint? 0.13..0.87, swatch?: colour swatch name (a global or spot colour or tint swatch links the stop, so swatch edits recolour it and a spot stop prints on its plate; a process colour just gives its colour), tint?: 0..100 (% of the linked swatch; default 100, or a tint swatch's own)}] (at least 2; a freeform gradient's points are recoloured along them), keepModel?: bool (as paint.setFill; a stop color the gradient already has keeps its model), angle?: deg counter-clockwise (0: the gradient runs left to right; radial, conic and diamond: the vector turns about the center), aspect?: % (radial, conic and diamond; a negative one mirrors a conic's sweep and is an error for the other kinds), reverse?: bool (the same ramp the other way round: the stops in reverse order, and a hue method turned the other way unless `method` is given too), dither?: bool (fills only: a linear, radial, conic or diamond gradient fill is drawn with fine noise that hides banding, and as pixels in SVG and PDF exports), item?: fill/stroke item index|null (omitted: the Appearance panel's active item when it is of the edited kind), aligned?: bool (as paint.setFill; without stroke, the kind of the row edited), ids?|id?, strokeMode?: within|along|across (strokes only: the gradient lies on the page and shows through the stroke, runs from the start of each subpath to its end, or runs from the stroke's left edge to its right all along it; with nothing selected, for the next object drawn; type characters' own strokes always paint within), target?: \"object\"|\"contents\"} edit the gradient in place (keeps its placement); solid/none paints become the default gradient. Without `item`, a Live Paint group's faces take a fill edit and its edges take a stroke edit. On a path directly in a graph series, the graph also stores the gradient when it is on the topmost visible fill or stroke (docs/mcp.md); on a graph label's row, or on a graph's axis line, tick mark or radar ring, the graph stores that object's topmost visible fill and stroke rows for every label or line of its kind (a line's gradient without its placement), and on its characters their gradient without its placement, fitted to each label. While the Live Paint Bucket is the active tool and no ids, id or item are given (a null ids or id counts as none), only the default changes (the paint the bucket paints with)",
+ "{stroke?: bool (default: the targeted item's kind, else the active proxy), kind?: linear|radial|conic|diamond|freeform (conic, also accepted as angle or conical, sweeps the stops once around the center, clockwise from the vector, with a seam where the last stop meets the first; diamond runs the stops from the center out to a square with a corner at the end of the vector; freeform places points on each object, coloured along the stops), mode?: points|lines (freeform: how the Gradient tool adds points), method?: classic|perceptual|hue-clockwise|hue-counterclockwise (how the colours between the stops mix: in display RGB, perceptually (OKLab) so the steps look even, or around the hue wheel: hue, saturation and brightness each change evenly from one stop to the next, the hue angle falling with hue-clockwise (red, magenta, blue, cyan, green, yellow) and rising with hue-counterclockwise; two stops whose hues are less than half a color level apart keep that hue; a stop whose RGB numbers are less than half a color level apart is gray and takes the hue of the stop it mixes with, and black that stop's saturation too; these two methods are VectorCraft's own, and SVG and PDF exports draw their gradients as RGB images, CMYK and spot color stops included; SVG exports draw a Perceptual gradient as an image, and PDF exports do too unless it is linear, radial, conic or diamond, has spot color stops, every other stop is paper white or written in CMYK or gray (an export that converts colors to a CMYK destination profile writes RGB and Lab stops in CMYK, and so does a CMYK document unless the export converts colors to an RGB destination profile), it is not a dithered fill and its curve does not have too many stops: then PDF writes tints of one spot ink as a Separation shading in that ink, and spot inks mixed with other spot, CMYK or gray inks as a DeviceN shading; freeform gradients mix their own way), spread?: pad|repeat|reflect (linear, radial, conic and diamond: what the gradient paints past the ends of its stops: pad carries the end colors on; repeat and reflect run the stops `repeats` times along the vector (around the circle, for a conic) and on past both ends, reflect mirroring every other run; an error on a freeform gradient), repeats?: 1..100 (a whole number: how many times repeat and reflect run the stops along the vector; VectorCraft's own limit; pad keeps it unused), stops?: [{offset 0..1, color? (needed without swatch; #rrggbbaa and #rgba are refused), opacity? 0..1 (or 0..100), midpoint? 0.13..0.87, swatch?: colour swatch name (a global or spot colour or tint swatch links the stop, so swatch edits recolour it and a spot stop prints on its plate; a process colour just gives its colour), tint?: 0..100 (% of the linked swatch; default 100, or a tint swatch's own)}] (at least 2; a freeform gradient's points are recoloured along them), keepModel?: bool (as paint.setFill; a stop color the gradient already has keeps its model), angle?: deg counter-clockwise (0: the gradient runs left to right; radial, conic and diamond: the vector turns about the center), aspect?: % (radial, conic and diamond; a negative one mirrors a conic's sweep and is an error for the other kinds; an error when no object is edited, as with nothing selected, the Live Paint Bucket's gradient, or a fill edit of a Live Paint group without faces: the default gradient fits each new object and keeps no aspect), reverse?: bool (the same ramp the other way round: the stops in reverse order, and a hue method turned the other way unless `method` is given too), dither?: bool (fills only: a linear, radial, conic or diamond gradient fill is drawn with fine noise that hides banding, and as pixels in SVG and PDF exports), item?: fill/stroke item index|null (omitted: the Appearance panel's active item when it is of the edited kind), aligned?: bool (as paint.setFill; without stroke, the kind of the row edited), ids?|id?, strokeMode?: within|along|across (strokes only: the gradient lies on the page and shows through the stroke, runs from the start of each subpath to its end, or runs from the stroke's left edge to its right all along it; with nothing selected, for the next object drawn; type characters' own strokes always paint within), target?: \"object\"|\"contents\"} edit the gradient in place (keeps its placement); solid/none paints become the default gradient. Without `item`, a Live Paint group's faces take a fill edit and its edges take a stroke edit. On a path directly in a graph series, the graph also stores the gradient when it is on the topmost visible fill or stroke (docs/mcp.md); on a graph label's row, or on a graph's axis line, tick mark or radar ring, the graph stores that object's topmost visible fill and stroke rows for every label or line of its kind (a line's gradient without its placement), and on its characters their gradient without its placement, fitted to each label. While the Live Paint Bucket is the active tool and no ids, id or item are given (a null ids or id counts as none), only the default changes (the paint the bucket paints with)",
has_doc,
edit_gradient
),
@@ -117,6 +117,17 @@ impl StopOwner {
}
impl Session {
+ /// Does `paint.editGradient` without `ids` edit objects on the fill (or the stroke, `stroke`)? It does not
+ /// while the Live Paint Bucket is active or when nothing it can paint is selected (a Live Paint group stands
+ /// only for its faces in a fill edit and its edges in a stroke edit): it then edits no object and takes no
+ /// `aspect`.
+ pub fn gradient_edit_has_objects(&self, stroke: bool) -> bool {
+ let p = json!({ "stroke": stroke });
+ !super::paint::for_bucket(self, &p)
+ && item_target(self, &p, "paint.editGradient")
+ .is_ok_and(|item| item.of_kind(self, !stroke).targets_for(self, &p, !stroke).is_ok_and(|ids| !ids.is_empty()))
+ }
+
/// The selected gradient stop (`gradient.selectStop`), while the gradient it was selected on
/// is still the one behind the active proxy. Callers check it against the stop count (an undo
/// can remove stops).
@@ -547,6 +558,12 @@ fn edit_gradient(s: &mut Session, p: &Value) -> Result {
// Objects were given or selected, even when all of them are graph design art left out below, or Live Paint group parts
// of the other kind left out above: the stroke mode is then not one for new art.
let selected = !ids.is_empty() || skipped;
+ // The default gradient for new art (and the bucket's) is fitted to each object, so it has no aspect of its own. A
+ // Live Paint group with no part of the edited kind gives no object either. Graph design art is left out below
+ // without an error, as for every other param.
+ if ids.is_empty() && p.get("aspect").is_some() {
+ return Err(bad(C, "`aspect` needs objects to place the gradient on: give ids or select objects"));
+ }
let ids = super::appearance::drop_design_art_rows(s, ids, item, !stroke, C)?;
// How the gradient lies on a stroke (the panel's Stroke buttons).
let mode = match str_param(p, "strokeMode") {
diff --git a/crates/engine/src/cmd/plugin_call/reviewed.rs b/crates/engine/src/cmd/plugin_call/reviewed.rs
index 531f58eb95..6d8277351c 100644
--- a/crates/engine/src/cmd/plugin_call/reviewed.rs
+++ b/crates/engine/src/cmd/plugin_call/reviewed.rs
@@ -572,6 +572,7 @@ pub(super) const ALLOWED: &[&str] = &[
"shape.rectangularGrid",
"shape.spiral",
"shape.star",
+ "shape.threePointArc",
"shapeBuilder.copyRegion",
"shapeBuilder.merge",
"shapeBuilder.regions",
diff --git a/crates/engine/src/cmd/swatch.rs b/crates/engine/src/cmd/swatch.rs
index 76003551cd..511352b9a5 100644
--- a/crates/engine/src/cmd/swatch.rs
+++ b/crates/engine/src/cmd/swatch.rs
@@ -6,7 +6,7 @@ use serde_json::{Value, json};
use vectorcraft_color::{Color, Gradient, GradientKind, GradientMethod, GradientStop, Paint, Swatch, SwatchGroup, tint_percent};
use vectorcraft_doc::pattern::pattern_paint;
use vectorcraft_doc::swatches::{LinkFn, PaintFn, color_name, map_node_paints, map_node_solid_paints, node_colors};
-use vectorcraft_doc::{Document, NodeId};
+use vectorcraft_doc::{Document, NodeId, Selection};
use super::paint::paint_from;
use super::{
@@ -77,7 +77,7 @@ pub fn specs() -> Vec {
"Add Used Colors",
["Window", "Swatches"],
None,
- "{selection?: false (only the selected art's colours; default: all the art's), global?: false (the new swatches are global and the matching unlinked colours in that art link to them)} add a swatch for each colour used (fills, strokes, text, gradient stops, mesh points) that no solid swatch has yet, as one undo step → {added: [names], linked}",
+ "{selection?: false (only the selected art's colours; default: all the art's), global?: false (the new swatches are global and the matching unlinked colours in that art link to them)} add a swatch for each colour used (fills, strokes, text, gradient stops, mesh points) that no solid swatch has yet, as one undo step (none when there is no new color; the Swatches panel menu's Add Selected Colors sends selection and global; with Global Edit on, the other members keep their colors) → {added: [names], linked}",
has_doc,
swatch_add_used
),
@@ -1037,20 +1037,41 @@ fn swatch_sort(s: &mut Session, _: &Value) -> Result {
ok()
}
+/// The colors of the art `ids` that no swatch links them to and no solid swatch has, each once, in
+/// paint order: the swatches Add Used Colors makes.
+fn new_used_colors(d: &Document, ids: &[NodeId]) -> Vec {
+ let (mut linked_to, mut colors) = (vec![], vec![]);
+ artwork_colors(d, ids, false, &mut linked_to, &mut colors);
+ // Colors a solid swatch already has are skipped.
+ let have: HashSet = d.swatches_iter().filter_map(|w| w.paint.color()).filter_map(|c| color_key(&c)).collect();
+ colors.retain(|c| color_key(c).is_none_or(|k| !have.contains(&k)));
+ colors
+}
+
fn swatch_add_used(s: &mut Session, p: &Value) -> Result {
const C: &str = "swatch.addUsedColors";
let global = switch_or(p, "global", false, C)?;
let only_selection = switch_or(p, "selection", false, C)?;
- let (added, linked) = s.edit("Add Used Colors", |d, sel| {
+ let used_ids = |d: &Document, sel: &Selection| -> Result> {
let ids: Vec = if only_selection { sel.objects.clone() } else { d.layers.iter().map(|l| l.id).collect() };
if only_selection && ids.is_empty() {
return Err(bad(C, "select artwork to add its colours"));
}
- let (mut linked_to, mut colors) = (vec![], vec![]);
- artwork_colors(d, &ids, false, &mut linked_to, &mut colors);
- // Colours a solid swatch already has are skipped.
- let have: HashSet = d.swatches_iter().filter_map(|w| w.paint.color()).filter_map(|c| color_key(&c)).collect();
- colors.retain(|c| color_key(c).is_none_or(|k| !have.contains(&k)));
+ Ok(ids)
+ };
+ // Typing in progress is its own undo step and is in the document the colors are read from.
+ super::variablecmds::settle_typing(s)?;
+ // With no new color there is nothing to add or link, so no edit and no undo step.
+ let st = s.doc()?;
+ if new_used_colors(&st.doc, &used_ids(&st.doc, &st.selection)?).is_empty() {
+ return Ok(json!({"added": [], "linked": 0}));
+ }
+ // Linking a paint to its new swatch keeps its color, so Global Edit gives the link to no other
+ // member: a member whose color differs keeps it.
+ let global_edit = s.doc_mut()?.global_edit.take();
+ let edited = s.edit("Add Used Colors", |d, sel| {
+ let ids = used_ids(&*d, &*sel)?;
+ let colors = new_used_colors(d, &ids);
let mut free = d.free_swatch_names();
let mut links = vec![];
for c in colors {
@@ -1060,7 +1081,9 @@ fn swatch_add_used(s: &mut Session, p: &Value) -> Result {
}
let linked = if global { link_colors(d, &ids, &links) } else { 0 };
Ok((links.into_iter().map(|(_, n)| n).collect::>(), linked))
- })?;
+ });
+ s.doc_mut()?.global_edit = global_edit;
+ let (added, linked) = edited?;
Ok(json!({"added": added, "linked": linked}))
}
diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs
index 2fb3425e2a..c0fe7d8e08 100644
--- a/crates/engine/src/tests.rs
+++ b/crates/engine/src/tests.rs
@@ -209,6 +209,7 @@ mod targeting;
mod textcombos;
mod textedit;
pub(super) mod textimport;
+mod three_point_arc;
mod tileedge;
mod tints;
mod toolsettings;
diff --git a/crates/engine/src/tests/build.rs b/crates/engine/src/tests/build.rs
index 9d1447adb8..424e5678bb 100644
--- a/crates/engine/src/tests/build.rs
+++ b/crates/engine/src/tests/build.rs
@@ -3331,6 +3331,68 @@ fn live_paint_bucket_paint_and_stroke_commands_leave_the_selection_unpainted() {
assert!(failed.is_empty(), "{failed:#?}");
}
+/// `paint.editGradient` with an `aspect` and no object to edit (the Live Paint Bucket's gradient,
+/// nothing selected, or a fill edit of a Live Paint group without faces) is an error that leaves the default gradient as it was, since a gradient
+/// fitted to each object has no aspect of its own. Named objects still take the aspect.
+#[test]
+fn edit_gradient_aspect_without_objects_is_an_error() {
+ let aspect = |n: &Node| match n.appearance.fill_paint() {
+ Paint::Gradient(g) => g.geom.map(|x| x.aspect),
+ _ => None,
+ };
+ let mut s = session();
+ let g = live(&mut s);
+ let rect = rect(&mut s, 300.0, 300.0, 40.0, 40.0);
+ s.execute("select.set", &json!({"ids": [g.0, rect.0]})).unwrap();
+ s.select_tool("livePaintBucket", ViewInfo::default()).unwrap();
+ s.execute("gradient.presets.apply", &json!({"name": "vignette"})).unwrap();
+ let (group, art, fill) = (node(&s, g), node(&s, rect), s.paint.fill.clone());
+ let steps = s.doc().unwrap().history.undo.len();
+ assert!(!s.gradient_edit_has_objects(false), "the bucket edits its own gradient");
+ for params in [json!({"stroke": false, "aspect": 50}), json!({"stroke": false, "aspect": 50, "reverse": true})] {
+ assert!(s.execute("paint.editGradient", ¶ms).is_err(), "{params}");
+ assert_eq!(s.paint.fill, fill, "{params}: the bucket's gradient stays");
+ }
+ assert_eq!((node(&s, g), node(&s, rect)), (group, art), "the selection keeps its paint");
+ assert_eq!(s.doc().unwrap().history.undo.len(), steps, "no undo step");
+ // Named objects take it.
+ s.execute("paint.editGradient", &json!({"stroke": false, "kind": "radial", "aspect": 50, "ids": [rect.0]})).unwrap();
+ assert_eq!(aspect(&node(&s, rect)), Some(0.5));
+ // Without the bucket and with nothing selected, the default gradient has no aspect either.
+ s.select_tool("selection", ViewInfo::default()).unwrap();
+ s.execute("select.set", &json!({"ids": []})).unwrap();
+ let fill = s.paint.fill.clone();
+ assert!(!s.gradient_edit_has_objects(false));
+ assert!(s.execute("paint.editGradient", &json!({"stroke": false, "aspect": 50})).is_err());
+ assert_eq!(s.paint.fill, fill, "the default gradient stays");
+ // An empty group has nothing to paint.
+ let empty = s
+ .edit("Group", |d, _| {
+ let id = d.alloc_id();
+ d.insert(d.default_layer(), 0, Node::group(id, vec![]))?;
+ Ok(id)
+ })
+ .unwrap();
+ s.execute("select.set", &json!({"ids": [empty.0]})).unwrap();
+ assert!(!s.gradient_edit_has_objects(false), "an empty group");
+ assert!(s.execute("paint.editGradient", &json!({"stroke": false, "aspect": 50})).is_err());
+ // A fill edit of a Live Paint group with edges and no faces edits no object; a stroke edit edits its edges.
+ let line = NodeId(s.execute("shape.line", &json!({"x1": 0, "y1": 0, "x2": 100, "y2": 0})).unwrap()["id"].as_u64().unwrap());
+ let edges_only = NodeId(s.execute("livePaint.make", &json!({"ids": [line.0]})).unwrap()["id"].as_u64().unwrap());
+ s.execute("select.set", &json!({"ids": [edges_only.0]})).unwrap();
+ let (fill, group, steps) = (s.paint.fill.clone(), node(&s, edges_only), s.doc().unwrap().history.undo.len());
+ assert!(!s.gradient_edit_has_objects(false), "a Live Paint group without faces");
+ assert!(s.gradient_edit_has_objects(true), "its edges take a stroke edit");
+ assert!(s.execute("paint.editGradient", &json!({"stroke": false, "aspect": 50})).is_err());
+ assert_eq!((&s.paint.fill, node(&s, edges_only)), (&fill, group), "the default and the group stay");
+ assert_eq!(s.doc().unwrap().history.undo.len(), steps, "no undo step");
+ // A selected object takes it.
+ s.execute("select.set", &json!({"ids": [rect.0]})).unwrap();
+ assert!(s.gradient_edit_has_objects(false) && s.gradient_edit_has_objects(true));
+ s.execute("paint.editGradient", &json!({"stroke": false, "aspect": 25})).unwrap();
+ assert_eq!(aspect(&node(&s, rect)), Some(0.25));
+}
+
/// With the Live Paint Bucket active, objects named with `ids` still take a stroke, and a brush
/// still goes to the selection.
#[test]
diff --git a/crates/engine/src/tests/swatchcmds.rs b/crates/engine/src/tests/swatchcmds.rs
index 1b87639ef9..ff02889253 100644
--- a/crates/engine/src/tests/swatchcmds.rs
+++ b/crates/engine/src/tests/swatchcmds.rs
@@ -125,6 +125,69 @@ fn add_used_colors_skips_colours_that_have_swatches() {
assert!(doc(&s).swatch("R=171 G=205 B=239").unwrap().global);
}
+/// A run that finds no new color, over all the art or the selection, records no undo step.
+#[test]
+fn add_used_colors_with_no_new_color_records_no_undo_step() {
+ let mut s = session();
+ let a = rect_filled(&mut s, json!({"color": "#123456"}));
+ run(&mut s, "swatch.addUsedColors", json!({}));
+ run(&mut s, "select.set", json!({"ids": [a.0]}));
+ let before = doc(&s).clone();
+ let undo = undo_len(&s);
+ for p in [json!({}), json!({"selection": true, "global": true})] {
+ assert_eq!(run(&mut s, "swatch.addUsedColors", p), json!({"added": [], "linked": 0}));
+ assert_eq!(undo_len(&s), undo);
+ assert_eq!(*doc(&s), before);
+ }
+ // An empty selection is still an error, with nothing changed.
+ run(&mut s, "select.set", json!({"ids": []}));
+ let undo = undo_len(&s);
+ assert!(s.execute("swatch.addUsedColors", &json!({"selection": true})).is_err());
+ assert_eq!(undo_len(&s), undo);
+}
+
+/// A run that finds no new color, while the Type tool is typing, still ends the typing session: the
+/// typing is its own undo step.
+#[test]
+fn add_used_colors_with_no_new_color_ends_the_typing() {
+ use vectorcraft_tools::{PointerEvent, PointerKind};
+ let mut s = session();
+ let v = ViewInfo::default();
+ let t = NodeId(run(&mut s, "text.create", json!({"x": 10, "y": 10, "text": "Hello"}))["id"].as_u64().unwrap());
+ run(&mut s, "swatch.addUsedColors", json!({}));
+ s.select_tool("type", v).unwrap();
+ let b = doc(&s).bounds_of(&[t], false).unwrap();
+ for kind in [PointerKind::Down, PointerKind::Up] {
+ s.pointer(&PointerEvent::new(kind, b.x1 - 1.0, b.center().y), v).unwrap();
+ }
+ s.tool_text("!", v).unwrap();
+ assert!(crate::cmd::typing_in_progress(&s));
+ let steps = undo_len(&s);
+ assert_eq!(run(&mut s, "swatch.addUsedColors", json!({})), json!({"added": [], "linked": 0}));
+ assert!(!crate::cmd::typing_in_progress(&s));
+ let labels: Vec = s.doc().unwrap().history.undo.iter().map(|e| e.label.clone()).collect();
+ assert_eq!((labels.len(), labels.last().map(String::as_str)), (steps + 1, Some("Typing")));
+}
+
+/// Add Selected Colors while Global Edit is on links only the selected art: a member of the same
+/// shape with another color keeps its color and stays unlinked, and Global Edit stays on.
+#[test]
+fn add_selected_colors_in_global_edit_keeps_the_other_members_colors() {
+ let mut s = session();
+ let a = rect_filled(&mut s, json!({"color": "#123456"}));
+ let b = rect_filled(&mut s, json!({"color": "#654321"}));
+ run(&mut s, "select.set", json!({"ids": [a.0]}));
+ let r = run(&mut s, "select.globalEdit", json!({}));
+ assert_eq!((r["active"].clone(), r["ids"].clone()), (json!(true), json!([a.0, b.0])), "the other rectangle is a member");
+ let other = fill(&s, b);
+ let undo = undo_len(&s);
+ run(&mut s, "swatch.addUsedColors", json!({"selection": true, "global": true}));
+ assert!(matches!(fill(&s, a), Paint::Solid { swatch: Some(_), .. }), "{:?}", fill(&s, a));
+ assert_eq!(fill(&s, b), other, "the unselected member keeps its color");
+ assert_eq!(undo_len(&s), undo + 1);
+ assert!(s.doc().unwrap().global_edit.is_some(), "Global Edit stays on");
+}
+
/// Give `id` the fill `p` exactly as written (a command would round or convert some colors).
fn set_fill(s: &mut Session, id: NodeId, p: Paint) {
std::sync::Arc::make_mut(&mut s.doc_mut().unwrap().doc).node_mut(id).unwrap().appearance.set_fill(p);
diff --git a/crates/engine/src/tests/three_point_arc.rs b/crates/engine/src/tests/three_point_arc.rs
new file mode 100644
index 0000000000..ebd755dda7
--- /dev/null
+++ b/crates/engine/src/tests/three_point_arc.rs
@@ -0,0 +1,220 @@
+//! `shape.threePointArc`: an open circular arc between two ends, through a third point or
+//! leaving an end toward it, and the Three-Point Arc tool's clicks that run it.
+
+use serde_json::{Value, json};
+use vectorcraft_doc::{Node, NodeKind};
+use vectorcraft_geom::Point;
+use vectorcraft_tools::{Mods, PointerEvent, PointerKind, ToolKey};
+
+use crate::*;
+
+const C: &str = "shape.threePointArc";
+
+fn session() -> Session {
+ let mut s = Session::new();
+ s.execute("file.new", &json!({"width": 400, "height": 400})).unwrap();
+ s
+}
+
+fn node(s: &Session, id: NodeId) -> Node {
+ s.doc().unwrap().doc.node(id).unwrap().clone()
+}
+
+fn undo_len(s: &Session) -> usize {
+ s.doc().unwrap().history.undo.len()
+}
+
+fn object_count(s: &Session) -> usize {
+ let mut n = 0;
+ s.doc().unwrap().doc.walk(|_| n += 1);
+ n
+}
+
+fn id_of(v: &Value) -> NodeId {
+ NodeId(v["id"].as_u64().unwrap())
+}
+
+/// The largest distance of `points` from the path of `id`.
+fn farthest_from_path(s: &Session, id: NodeId, points: &[Point]) -> f64 {
+ let n = node(s, id);
+ let path = n.path_data().unwrap();
+ points.iter().map(|p| path.nearest(*p).unwrap().4).fold(0.0, f64::max)
+}
+
+/// The arc from (0, 0) to (80, 0) through (40, -40) is the upper half of the circle about
+/// (40, 0) with radius 40: an open path from one end to the other, through the third point, with
+/// no fill and a stroke, selected, and one undo step.
+#[test]
+fn the_arc_through_a_third_point_is_an_open_path_and_one_undo_step() {
+ let mut s = session();
+ let undo = undo_len(&s);
+ let out = s.execute(C, &json!({"start": [0, 0], "end": [80, 0], "through": [40, -40]})).unwrap();
+ assert_eq!((out["cx"].as_f64(), out["cy"].as_f64(), out["radius"].as_f64()), (Some(40.0), Some(0.0), Some(40.0)), "{out}");
+ // From (0, 0) over the top to (80, 0): clockwise on the page.
+ assert!((out["sweep"].as_f64().unwrap() - 180.0).abs() < 1e-9, "{out}");
+ let id = id_of(&out);
+ let n = node(&s, id);
+ let NodeKind::Path { path, live: None, .. } = &n.kind else { panic!("not a plain path: {:?}", n.kind) };
+ let sp = &path.subpaths[0];
+ assert!(!sp.closed && path.subpaths.len() == 1);
+ assert_eq!((sp.anchors.first().map(|a| a.p), sp.anchors.last().map(|a| a.p)), (Some(Point::ORIGIN), Some(Point::new(80.0, 0.0))));
+ assert!(farthest_from_path(&s, id, &[Point::new(40.0, -40.0)]) < 1e-9);
+ assert!(n.appearance.fill_paint().is_none(), "no fill");
+ assert!(!n.appearance.stroke_paint().is_none(), "a stroke");
+ assert_eq!(s.doc().unwrap().selection.objects, [id]);
+ assert_eq!(undo_len(&s), undo + 1);
+ s.execute("edit.undo", &json!({})).unwrap();
+ assert!(s.doc().unwrap().doc.node(id).is_none());
+ // A third point between the quarter turns is an anchor too, so the path meets it exactly.
+ let via = Point::new(1000.0 * 20f64.to_radians().cos(), 1000.0 * 20f64.to_radians().sin());
+ let out = s.execute(C, &json!({"start": [1000, 0], "end": [0, 1000], "through": [via.x, via.y]})).unwrap();
+ let id = id_of(&out);
+ assert!(node(&s, id).path_data().unwrap().subpaths[0].anchors.iter().any(|a| a.p == via));
+ assert!(farthest_from_path(&s, id, &[via]) < 1e-9);
+}
+
+/// With `toward`, the arc leaves `start` heading at the point (its first handle points there),
+/// or with `at: "end"` arrives at `end` along the line from the point to `end` (run backward, the
+/// arc leaves `end` heading at the point).
+#[test]
+fn the_arc_toward_a_point_has_that_tangent_at_its_end() {
+ let mut s = session();
+ let out = s.execute(C, &json!({"start": [0, 0], "end": [80, 0], "toward": [30, -30]})).unwrap();
+ let n = node(&s, id_of(&out));
+ let first = n.path_data().unwrap().subpaths[0].anchors[0];
+ let d = (first.h_out - first.p).normalize();
+ assert!((d.dot(vectorcraft_geom::Vec2::new(1.0, -1.0).normalize()) - 1.0).abs() < 1e-12, "{d:?}");
+ // A quarter turn's tangent: the center is at (40, 40) and the radius √3200.
+ assert!((out["radius"].as_f64().unwrap() - 3200f64.sqrt()).abs() < 1e-9, "{out}");
+ let out = s.execute(C, &json!({"start": [0, 0], "end": [80, 0], "toward": [50, -30], "at": "end"})).unwrap();
+ let n = node(&s, id_of(&out));
+ let last = *n.path_data().unwrap().subpaths[0].anchors.last().unwrap();
+ let d = (last.p - last.h_in).normalize();
+ assert!((d.dot(vectorcraft_geom::Vec2::new(1.0, 1.0).normalize()) - 1.0).abs() < 1e-12, "{d:?}");
+ // The direction from the start and from the end mirror each other.
+ assert!((out["cx"].as_f64().unwrap() - 40.0).abs() < 1e-9 && (out["cy"].as_f64().unwrap() - 40.0).abs() < 1e-9, "{out}");
+}
+
+/// Points that are the same, a third point on the line through the ends, and an arc reaching past
+/// the canvas are refused with a message; nothing is drawn and no undo step is added.
+#[test]
+fn points_with_no_arc_are_refused() {
+ let mut s = session();
+ let (undo, count) = (undo_len(&s), object_count(&s));
+ for p in [
+ json!({"start": [0, 0], "end": [0, 0], "through": [10, 10]}),
+ json!({"start": [0, 0], "end": [80, 0], "through": [40, 0]}),
+ json!({"start": [0, 0], "end": [80, 0], "through": [120, 0]}),
+ json!({"start": [0, 0], "end": [80, 0], "through": [80, 0]}),
+ json!({"start": [0, 0], "end": [80, 0], "toward": [0, 0]}),
+ json!({"start": [0, 0], "end": [80, 0], "toward": [-50, 0]}),
+ json!({"start": [0, 0], "end": [80, 0], "toward": [40, 0], "at": "end"}),
+ json!({"start": [0, 0], "end": [0, 0], "toward": [10, 10]}),
+ ] {
+ let e = s.execute(C, &p).unwrap_err().to_string();
+ assert!(e.contains("no arc fits these points"), "{p}: {e}");
+ }
+ // Nearly in line beyond the end: the circle's center is about 1.2·10⁷ pt down the page, and the
+ // arc goes round the far side of it.
+ let far = json!({"start": [0, 0], "end": [80, 0], "through": [200, 0.001]});
+ let e = s.execute(C, &far).unwrap_err().to_string();
+ assert!(e.contains("result would exceed the canvas"), "{e}");
+ assert_eq!((undo_len(&s), object_count(&s)), (undo, count));
+}
+
+/// Missing or malformed points, both or neither of `through` and `toward`, an `at` that is not
+/// "start" or "end", and an `at` with `through` are errors; nothing is drawn.
+#[test]
+fn malformed_params_are_refused() {
+ let mut s = session();
+ let count = object_count(&s);
+ for (p, want) in [
+ (json!({"end": [80, 0], "through": [40, 40]}), "`start` must be [x, y]"),
+ (json!({"start": [0, 0], "end": [80], "through": [40, 40]}), "`end` must be [x, y]"),
+ (json!({"start": [0, 0], "end": [80, 0], "through": [40, "a"]}), "`through` must be [x, y]"),
+ (json!({"start": [0, 0], "end": [80, 0], "through": null}), "`through` must be [x, y]"),
+ (json!({"start": [0, 0], "end": [80, 0], "toward": [10, 0, 0]}), "`toward` must be [x, y]"),
+ (json!({"start": [0, 0], "end": [80, 0]}), "give exactly one of `through` and `toward`"),
+ (json!({"start": [0, 0], "end": [80, 0], "through": [40, 40], "toward": [0, 40]}), "give exactly one of `through` and `toward`"),
+ (json!({"start": [0, 0], "end": [80, 0], "toward": [0, 40], "at": "middle"}), "`at` must be \"start\" or \"end\""),
+ (json!({"start": [0, 0], "end": [80, 0], "toward": [0, 40], "at": null}), "`at` must be \"start\" or \"end\""),
+ (json!({"start": [0, 0], "end": [80, 0], "through": [40, 40], "at": "end"}), "give `at` only with `toward`"),
+ (json!({"start": [0, 0], "end": [80, 0], "through": [40, 40], "at": "start"}), "give `at` only with `toward`"),
+ ] {
+ let e = s.execute(C, &p).unwrap_err().to_string();
+ assert!(e.contains(want), "{p}: {e}");
+ }
+ assert_eq!(object_count(&s), count);
+}
+
+/// With Align New Objects to Pixel Grid on, the ends stay on the given points.
+#[test]
+fn the_arc_is_not_moved_onto_the_pixel_grid() {
+ let mut s = session();
+ s.execute("document.setup", &json!({"alignNewObjectsToPixelGrid": true})).unwrap();
+ let id = id_of(&s.execute(C, &json!({"start": [0.3, 0.2], "end": [80.6, 0.1], "through": [40.4, -39.7]})).unwrap());
+ let n = node(&s, id);
+ let sp = &n.path_data().unwrap().subpaths[0];
+ assert_eq!(sp.anchors.first().map(|a| a.p), Some(Point::new(0.3, 0.2)));
+ assert_eq!(sp.anchors.last().map(|a| a.p), Some(Point::new(80.6, 0.1)));
+ assert!(!n.extras().pixel_aligned);
+}
+
+fn view() -> ViewInfo {
+ ViewInfo { smart_guides: false, ..ViewInfo::default() }
+}
+
+fn click(s: &mut Session, x: f64, y: f64) {
+ for k in [PointerKind::Down, PointerKind::Up] {
+ s.pointer(&PointerEvent::new(k, x, y).with_mods(Mods::default()), view()).unwrap();
+ }
+}
+
+/// With the Three-Point Arc tool, three clicks draw the arc in one undo step; `]` before the third
+/// click makes the third point give the direction instead. Escape drops the ends.
+#[test]
+fn three_clicks_with_the_tool_draw_the_arc() {
+ let mut s = session();
+ s.select_tool("threePointArc", view()).unwrap();
+ let (undo, count) = (undo_len(&s), object_count(&s));
+ click(&mut s, 100.0, 200.0);
+ click(&mut s, 180.0, 200.0);
+ assert_eq!((undo_len(&s), object_count(&s)), (undo, count), "two ends draw nothing yet");
+ click(&mut s, 140.0, 160.0);
+ assert_eq!(undo_len(&s), undo + 1);
+ let id = *s.doc().unwrap().selection.objects.first().unwrap();
+ assert!(farthest_from_path(&s, id, &[Point::new(100.0, 200.0), Point::new(140.0, 160.0), Point::new(180.0, 200.0)]) < 1e-9);
+ // Escape after the ends: the next clicks start afresh.
+ click(&mut s, 0.0, 0.0);
+ click(&mut s, 10.0, 300.0);
+ s.tool_key(ToolKey::Escape, Mods::default(), view()).unwrap();
+ click(&mut s, 100.0, 300.0);
+ click(&mut s, 180.0, 300.0);
+ s.tool_key(ToolKey::BracketRight, Mods::default(), view()).unwrap();
+ let undo = undo_len(&s);
+ // Straight up from the first end: the upper half circle about (140, 300).
+ click(&mut s, 100.0, 250.0);
+ assert_eq!(undo_len(&s), undo + 1);
+ let id = *s.doc().unwrap().selection.objects.first().unwrap();
+ assert!(farthest_from_path(&s, id, &[Point::new(140.0, 260.0)]) < 1e-9);
+}
+
+/// `tool.setOption` (the Tool Options dialog's Save) sets the tool's `direction` option, and
+/// refuses a value that is not true or false, or an option the tool doesn't have.
+#[test]
+fn set_option_sets_the_direction_and_refuses_bad_values() {
+ let mut s = session();
+ for on in [true, false] {
+ let set = s.set_tool_option_cmd(&json!({"tool": "threePointArc", "values": {"direction": on}})).unwrap();
+ assert_eq!(set["direction"], json!(on));
+ assert_eq!(s.tool_options_of("threePointArc")["direction"], json!(on));
+ }
+ let cases = [
+ (json!({"tool": "threePointArc", "key": "direction", "value": "yes"}), "tool `threePointArc`: `direction` must be true or false"),
+ (json!({"tool": "threePointArc", "key": "bogus", "value": true}), "tool `threePointArc`: unknown option `bogus`"),
+ ];
+ for (p, want) in cases {
+ assert_eq!(s.set_tool_option_cmd(&p).unwrap_err(), want, "{p}");
+ }
+ assert_eq!(s.tool_options_of("threePointArc")["direction"], json!(false));
+}
diff --git a/crates/geom/src/shapes.rs b/crates/geom/src/shapes.rs
index 5641900186..1cb52b4559 100644
--- a/crates/geom/src/shapes.rs
+++ b/crates/geom/src/shapes.rs
@@ -570,6 +570,143 @@ pub fn arc(a: Point, b: Point, slope: f64, closed: bool, _base_along_x: bool) ->
PathData::single(SubPath::new(anchors, closed))
}
+/// A circular arc from `start` to `end`: its circle's `center` and `radius`, and the turn from
+/// `start` to `end` about the center in radians, positive the way the angle `atan2(y, x)` grows
+/// (clockwise on the y-down page). The turn is never 0 and never a whole turn.
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub struct CircularArc {
+ pub start: Point,
+ pub end: Point,
+ pub center: Point,
+ pub radius: f64,
+ pub sweep: f64,
+}
+
+impl CircularArc {
+ /// The arc from `start` to `end` that passes through `through`. `None` when two of the points
+ /// are the same or the three lie on one line ([`circle_through`]).
+ pub fn through(start: Point, end: Point, through: Point) -> Option {
+ let (center, radius) = circle_through(start, end, through)?;
+ let angle = |p: Point| (p.y - center.y).atan2(p.x - center.x);
+ let a = angle(start);
+ let to_end = (angle(end) - a).rem_euclid(TAU);
+ let to_through = (angle(through) - a).rem_euclid(TAU);
+ // The turn that goes past `through` on its way to `end`.
+ let sweep = if to_through < to_end { to_end } else { to_end - TAU };
+ Self::checked(start, end, center, radius, sweep)
+ }
+
+ /// The arc that leaves `start` heading along `direction` (its tangent there) and ends at
+ /// `end`. `None` when `start` and `end` are the same, `direction` is zero, or `end` lies on the
+ /// line through `start` along `direction` (no circle touches that line at `start` and passes
+ /// through `end`). The same test as [`circle_through`] decides that: twice the area of the
+ /// triangle `start`, `end` and `start + direction` scaled to the chord's length is at most
+ /// 10⁻¹⁰ of the chord's length squared.
+ pub fn leaving(start: Point, direction: Vec2, end: Point) -> Option {
+ let len = direction.hypot();
+ let chord = end - start;
+ let c2 = chord.hypot2();
+ if !(len.is_finite() && len > 0.0 && c2.is_finite() && c2 > 0.0) {
+ return None;
+ }
+ let t = direction / len;
+ // Twice the triangle's area with the tangent as long as the chord.
+ let cross = t.cross(chord);
+ if cross.is_nan() || (cross * c2.sqrt()).abs() <= 1e-10 * c2 {
+ return None;
+ }
+ // The center lies on the normal at `start` on the side `end` is: `start + n * s` with
+ // `|n * s - chord| = |s|`, so `s = |chord|² / (2 n·chord)`.
+ let n = Vec2::new(-t.y, t.x);
+ let s = c2 / (2.0 * n.dot(chord));
+ let center = start + n * s;
+ let radius = s.abs();
+ let angle = |p: Point| (p.y - center.y).atan2(p.x - center.x);
+ let a = angle(start);
+ let to_end = (angle(end) - a).rem_euclid(TAU);
+ // Leaving along `t`: the turn grows when `t` points the way the angle grows at `start`.
+ let grows = Vec2::new(-(start.y - center.y), start.x - center.x).dot(t) > 0.0;
+ let sweep = if grows { to_end } else { to_end - TAU };
+ Self::checked(start, end, center, radius, sweep)
+ }
+
+ /// The arc that ends at `end` arriving along `direction` and starts at `start`: [`Self::leaving`]
+ /// from `end` back along `-direction`, turned round.
+ pub fn arriving(start: Point, end: Point, direction: Vec2) -> Option {
+ let back = Self::leaving(end, -direction, start)?;
+ Some(Self { start, end, center: back.center, radius: back.radius, sweep: -back.sweep })
+ }
+
+ fn checked(start: Point, end: Point, center: Point, radius: f64, sweep: f64) -> Option {
+ let ok = center.is_finite() && radius.is_finite() && radius > 0.0 && sweep.is_finite() && sweep != 0.0 && sweep.abs() < TAU;
+ ok.then_some(Self { start, end, center, radius, sweep })
+ }
+
+ /// The point at `t` (0 at `start`, 1 at `end`) along the arc.
+ pub fn at(&self, t: f64) -> Point {
+ let a = (self.start.y - self.center.y).atan2(self.start.x - self.center.x) + self.sweep * t;
+ Point::new(self.center.x + self.radius * a.cos(), self.center.y + self.radius * a.sin())
+ }
+
+ /// The open path of the arc: an anchor at `start`, at `end`, and between them as many smooth
+ /// anchors, evenly spaced, as keep each cubic piece to a quarter turn at most. The ends are the
+ /// given points exactly.
+ pub fn to_path(&self) -> PathData {
+ let quarter = std::f64::consts::FRAC_PI_2;
+ // A quarter turn and a hair more is still one piece.
+ let pieces = ((self.sweep.abs() / quarter) - 1e-9).ceil().clamp(1.0, 4.0) as u32;
+ let step = self.sweep / f64::from(pieces);
+ // The handle length of a cubic that follows a circle through the turn `step`, per unit
+ // of radius; negative when the arc runs the other way.
+ let k = 4.0 / 3.0 * (step / 4.0).tan();
+ let a0 = (self.start.y - self.center.y).atan2(self.start.x - self.center.x);
+ let mut anchors = Vec::with_capacity(pieces as usize + 1);
+ for i in 0..=pieces {
+ let a = a0 + step * f64::from(i);
+ let p = if i == 0 {
+ self.start
+ } else if i == pieces {
+ self.end
+ } else {
+ Point::new(self.center.x + self.radius * a.cos(), self.center.y + self.radius * a.sin())
+ };
+ // The handle along the tangent the way the arc runs.
+ let d = Vec2::new(-a.sin(), a.cos()) * (self.radius * k);
+ let h_in = if i == 0 { p } else { p - d };
+ let h_out = if i == pieces { p } else { p + d };
+ let kind = if i == 0 || i == pieces { AnchorKind::Corner } else { AnchorKind::Smooth };
+ anchors.push(Anchor { p, h_in, h_out, kind });
+ }
+ PathData::single(SubPath::new(anchors, false))
+ }
+
+ /// [`Self::to_path`] with a smooth anchor at `via`, a point on the arc such as the one
+ /// [`Self::through`] passes through, so the path passes through it exactly: the arc to `via`
+ /// and the arc on from it, each cut into quarter turns at most. A `via` at an end, or off the
+ /// stretch between the ends, gives [`Self::to_path`].
+ pub fn to_path_via(&self, via: Point) -> PathData {
+ let angle = |p: Point| (p.y - self.center.y).atan2(p.x - self.center.x);
+ let turn = (angle(via) - angle(self.start)).rem_euclid(TAU);
+ // The turn from `start` to `via` the way the arc runs.
+ let to_via = if self.sweep > 0.0 { turn } else { turn - TAU };
+ let share = to_via / self.sweep;
+ if !(share > 0.0 && share < 1.0) || via == self.start || via == self.end {
+ return self.to_path();
+ }
+ let first = Self { end: via, sweep: to_via, ..*self }.to_path();
+ let second = Self { start: via, sweep: self.sweep - to_via, ..*self }.to_path();
+ let (Some(a), Some(b)) = (first.subpaths.into_iter().next(), second.subpaths.into_iter().next()) else { return self.to_path() };
+ let mut anchors: Vec = a.anchors.iter().copied().collect();
+ let mut rest = b.anchors.iter().copied();
+ if let (Some(joint), Some(next)) = (anchors.last_mut(), rest.next()) {
+ joint.h_out = next.h_out;
+ joint.kind = AnchorKind::Smooth;
+ }
+ anchors.extend(rest);
+ PathData::single(SubPath::new(anchors, false))
+ }
+}
+
/// Logarithmic spiral with decay per full wind (`segments` quarter turns).
pub fn spiral(center: Point, radius: f64, decay_percent: f64, segments: u32, clockwise: bool) -> PathData {
let decay = (decay_percent / 100.0).clamp(0.05, 0.9999);
@@ -846,6 +983,144 @@ mod tests {
assert!(c.distance(Point::new(4.0, 3.0) + far) < 1e-6 && (radius - 5.0).abs() < 1e-6, "{c:?} {radius}");
}
+ /// Every point of `path`'s cubics lies on the arc's circle (to 3·10⁻⁴ of the radius, the
+ /// quarter-turn cubic's error), and the path runs from the arc's start to its end.
+ fn assert_on_circle(arc: &CircularArc) {
+ use kurbo::ParamCurve;
+ let path = arc.to_path();
+ let sp = &path.subpaths[0];
+ assert!(!sp.closed);
+ assert_eq!(sp.anchors.first().map(|a| a.p), Some(arc.start));
+ assert_eq!(sp.anchors.last().map(|a| a.p), Some(arc.end));
+ for seg in path.to_bezpath().segments() {
+ for i in 0..=8 {
+ let p = seg.eval(f64::from(i) / 8.0);
+ assert!((p.distance(arc.center) - arc.radius).abs() <= 3e-4 * arc.radius, "{p:?} off the circle");
+ }
+ }
+ }
+
+ /// The arc through a third point: from (0, 0) to (8, 0) through (4, -2) (above the chord on the
+ /// page) bulges up; through (4, 2) it bulges down; each has the circle through the three points
+ /// and goes past the third point. Through (4, 10) it is the larger part of its circle.
+ #[test]
+ fn the_arc_through_a_point_passes_through_it() {
+ let (a, b) = (Point::ORIGIN, Point::new(8.0, 0.0));
+ for (c, major) in
+ [(Point::new(4.0, -2.0), false), (Point::new(4.0, 2.0), false), (Point::new(4.0, 10.0), true), (Point::new(-1.0, -3.0), true)]
+ {
+ let arc = CircularArc::through(a, b, c).unwrap();
+ let (center, radius) = circle_through(a, b, c).unwrap();
+ assert!(arc.center.distance(center) < 1e-12 && (arc.radius - radius).abs() < 1e-12);
+ assert_eq!(arc.sweep.abs() > PI, major, "{c:?}: {}", arc.sweep);
+ // The third point is on the arc: some point along it is the third point.
+ let nearest = (0..=10_000).map(|i| arc.at(f64::from(i) / 10_000.0).distance(c)).fold(f64::INFINITY, f64::min);
+ assert!(nearest < 0.01, "{c:?}: {nearest}");
+ assert!(arc.at(0.0).distance(a) < 1e-12 && arc.at(1.0).distance(b) < 1e-9);
+ assert_on_circle(&arc);
+ }
+ // A half circle: two pieces, its middle anchor at the third point.
+ let arc = CircularArc::through(a, b, Point::new(4.0, -4.0)).unwrap();
+ let path = arc.to_path();
+ assert_eq!(path.subpaths[0].anchors.len(), 3);
+ assert!(path.subpaths[0].anchors[1].p.distance(Point::new(4.0, -4.0)) < 1e-12);
+ assert_eq!(path.subpaths[0].anchors[1].kind, AnchorKind::Smooth);
+ // Almost a whole circle: four pieces.
+ let arc = CircularArc::through(a, Point::new(0.0, 0.01), Point::new(8.0, 0.0)).unwrap();
+ assert_eq!(arc.to_path().subpaths[0].anchors.len(), 5);
+ assert_on_circle(&arc);
+ }
+
+ /// With an anchor at the third point, the path passes through it exactly, whichever way the
+ /// arc runs, even where one cubic would miss it (a quarter turn of radius 1000 misses a point
+ /// 20° along by about 0.27). Each part keeps to a quarter turn, the anchor there is smooth, and
+ /// a point at an end leaves the path as `to_path` makes it.
+ #[test]
+ fn the_path_via_the_third_point_passes_through_it_exactly() {
+ let center = Point::new(0.0, 0.0);
+ let on = |deg: f64| Point::new(1000.0 * deg.to_radians().cos(), 1000.0 * deg.to_radians().sin());
+ for (a, b, c) in [(0.0, 90.0, 20.0), (90.0, 0.0, 20.0), (0.0, 300.0, 170.0), (300.0, 0.0, 10.0)] {
+ let arc = CircularArc::through(on(a), on(b), on(c)).unwrap();
+ assert!(arc.center.distance(center) < 1e-6);
+ let path = arc.to_path_via(on(c));
+ let sp = &path.subpaths[0];
+ let joint = sp.anchors.iter().find(|x| x.p == on(c)).expect("an anchor at the third point");
+ assert_eq!(joint.kind, AnchorKind::Smooth);
+ assert_eq!((sp.anchors.first().map(|x| x.p), sp.anchors.last().map(|x| x.p)), (Some(arc.start), Some(arc.end)));
+ // No piece turns more than a quarter turn.
+ let points: Vec = sp.anchors.iter().map(|x| x.p).collect();
+ for w in points.windows(2) {
+ let (u, v) = (w[0] - arc.center, w[1] - arc.center);
+ assert!(u.cross(v).atan2(u.dot(v)).abs() <= std::f64::consts::FRAC_PI_2 + 1e-9, "{a} {b} {c}");
+ }
+ use kurbo::ParamCurve;
+ for seg in path.to_bezpath().segments() {
+ for i in 0..=8 {
+ let p = seg.eval(f64::from(i) / 8.0);
+ assert!((p.distance(arc.center) - arc.radius).abs() <= 0.3, "{p:?} off the circle");
+ }
+ }
+ }
+ // A third point a hair from an end is still an anchor.
+ let near = Point::new(1000.0, 0.0000005);
+ let arc = CircularArc::through(on(0.0), on(90.0), near).unwrap();
+ assert!(arc.to_path_via(near).subpaths[0].anchors.iter().any(|x| x.p == near));
+ let arc = CircularArc::through(on(0.0), on(90.0), on(20.0)).unwrap();
+ assert_eq!(arc.to_path_via(on(0.0)), arc.to_path());
+ assert_eq!(arc.to_path_via(on(180.0)), arc.to_path());
+ }
+
+ /// The arc that leaves its start along a direction: from (0, 0) heading up the page (-y) to
+ /// (8, 0) is the upper half circle about (4, 0); heading down, the lower one. Its tangent at the
+ /// start is the direction, and arriving at the end mirrors it.
+ #[test]
+ fn the_arc_leaving_along_a_direction_has_that_tangent() {
+ let (a, b) = (Point::ORIGIN, Point::new(8.0, 0.0));
+ let up = CircularArc::leaving(a, Vec2::new(0.0, -3.0), b).unwrap();
+ assert!(up.center.distance(Point::new(4.0, 0.0)) < 1e-12 && (up.radius - 4.0).abs() < 1e-12);
+ assert!(up.at(0.5).distance(Point::new(4.0, -4.0)) < 1e-9, "{:?}", up.at(0.5));
+ let down = CircularArc::leaving(a, Vec2::new(0.0, 3.0), b).unwrap();
+ assert!(down.at(0.5).distance(Point::new(4.0, 4.0)) < 1e-9, "{:?}", down.at(0.5));
+ // Leaving at 45° up and right: a quarter circle, tangent along the direction.
+ for d in [Vec2::new(1.0, -1.0), Vec2::new(1.0, 1.0), Vec2::new(-1.0, -0.2), Vec2::new(-1.0, 3.0)] {
+ let arc = CircularArc::leaving(a, d, b).unwrap();
+ let first = &arc.to_path().subpaths[0].anchors[0];
+ let tangent = first.h_out - first.p;
+ assert!((tangent.normalize().dot(d.normalize()) - 1.0).abs() < 1e-12, "{d:?}: {tangent:?}");
+ assert_on_circle(&arc);
+ // Arriving along a direction at the end: the tangent into the end is the direction.
+ let arc = CircularArc::arriving(a, b, d).unwrap();
+ let last = arc.to_path().subpaths[0].anchors.last().copied().unwrap();
+ let tangent = last.p - last.h_in;
+ assert!((tangent.normalize().dot(d.normalize()) - 1.0).abs() < 1e-12, "{d:?}: {tangent:?}");
+ assert_eq!((arc.start, arc.end), (a, b));
+ assert_on_circle(&arc);
+ }
+ }
+
+ /// No arc for points that are the same, a third point on the chord's line, a zero or not
+ /// finite direction, or a direction along the chord's line.
+ #[test]
+ fn degenerate_points_give_no_arc() {
+ let (a, b) = (Point::new(1.0, 2.0), Point::new(5.0, 7.0));
+ assert_eq!(CircularArc::through(a, a, b), None);
+ assert_eq!(CircularArc::through(a, b, b), None);
+ assert_eq!(CircularArc::through(a, b, a.midpoint(b)), None);
+ assert_eq!(CircularArc::through(a, b, a + (b - a) * 3.0), None);
+ assert_eq!(CircularArc::through(a, b, Point::new(f64::INFINITY, 0.0)), None);
+ assert_eq!(CircularArc::leaving(a, Vec2::new(1.0, 0.0), a), None);
+ assert_eq!(CircularArc::leaving(a, Vec2::ZERO, b), None);
+ assert_eq!(CircularArc::leaving(a, Vec2::new(f64::NAN, 1.0), b), None);
+ assert_eq!(CircularArc::leaving(a, b - a, b), None);
+ assert_eq!(CircularArc::leaving(a, a - b, b), None);
+ assert_eq!(CircularArc::arriving(a, b, b - a), None);
+ // Off the line by 10⁻⁴ over a chord of 2000 still makes an arc.
+ let (p, q) = (Point::new(-1000.0, 0.0), Point::new(1000.0, 0.0));
+ assert!(CircularArc::leaving(p, Vec2::new(2000.0, 1e-4), q).is_some());
+ // Off the line by 10⁻¹² of the chord is in line: no arc, rather than a circle 10¹² chords wide.
+ assert_eq!(CircularArc::leaving(p, Vec2::new(1.0, 1e-12), q), None);
+ }
+
/// Two points that are the same, or three on one line, give no circle.
#[test]
fn coincident_or_collinear_points_give_no_circle() {
diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs
index 4e426804c8..3b1fe9a1d8 100644
--- a/crates/mcp/src/ui_catalog.rs
+++ b/crates/mcp/src/ui_catalog.rs
@@ -837,7 +837,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
"retype.find",
"Find Matching Fonts",
"",
- "{more?: bool} show the Retype panel and list the fonts whose glyphs match the selected outlined text, compared and ranked as type.retypeFonts does (up to 96 loaded fonts, those of the document's live type first): ten, as Find Matching Fonts does, or with more: true the next five fonts the last search found (whatever is selected now; before any search, a first search), as Find more font matches does; the document does not change; a search with no path or compound path selected, or a more that is not true or false, is an error and leaves the list as it was; returns what retype.list returns",
+ "{more?: bool} show the Retype panel and list the fonts whose glyphs match the selected outlined text, compared and ranked as type.retypeFonts does (up to 96 loaded fonts, those of the document's live type first): ten, as Find Matching Fonts does (more false, omitted or null: a new search), or with more: true the next five fonts the last search found (whatever is selected now; before any search, a first search), as Find more font matches does; the document does not change; a search with no path or compound path selected, or a more other than true, false or null, is an error and leaves the list as it was; returns what retype.list returns",
),
(
"retype.list",
diff --git a/crates/tools/src/catalog.rs b/crates/tools/src/catalog.rs
index 436e779ab5..2dc0774aa2 100644
--- a/crates/tools/src/catalog.rs
+++ b/crates/tools/src/catalog.rs
@@ -49,6 +49,7 @@ pub const TOOL_GROUPS: &[&[ToolInfo]] = &[
&[
t("lineSegment", "Line Segment Tool", Some("\\"), "tool-line"),
t("arc", "Arc Tool", None, "tool-arc"),
+ t(crate::three_point_arc::ID, "Three-Point Arc Tool", None, "tool-three-point-arc"),
t("spiral", "Spiral Tool", None, "tool-spiral"),
t("rectangularGrid", "Rectangular Grid Tool", None, "tool-rect-grid"),
t("polarGrid", "Polar Grid Tool", None, "tool-polar-grid"),
diff --git a/crates/tools/src/lib.rs b/crates/tools/src/lib.rs
index 9483943af6..f06c5cd5a6 100644
--- a/crates/tools/src/lib.rs
+++ b/crates/tools/src/lib.rs
@@ -48,6 +48,7 @@ pub mod sidewidget;
pub mod slice;
pub mod symbolism;
pub mod text;
+pub mod three_point_arc;
pub mod touchtype;
pub mod trace_split;
pub mod typewidget;
@@ -392,6 +393,7 @@ pub fn create(id: &str) -> Box {
quickpen::ID => Box::new(quickpen::QuickPenTool::default()),
// Not in the toolbar: `file.place.queue` loads it.
"place" => Box::new(place::PlaceTool::default()),
+ three_point_arc::ID => Box::new(three_point_arc::ThreePointArcTool::default()),
other => symbolism::create(other)
.or_else(|| builder::create(other))
.or_else(|| draw2::create(other))
diff --git a/crates/tools/src/settings.rs b/crates/tools/src/settings.rs
index afcbc3196f..65b5860b4f 100644
--- a/crates/tools/src/settings.rs
+++ b/crates/tools/src/settings.rs
@@ -48,6 +48,7 @@ const ROWS: &[Row] = &[
(&["mirrorCut"], None, &["axis", "keep"]),
(&["puppetWarp"], None, &["showMesh", "expand"]),
(&["arc"], None, &["closed", "lengthX", "lengthY", "reference", "baseAlong", "slope", "fillArc"]),
+ (&[crate::three_point_arc::ID], None, &["direction"]),
(&["spiral"], None, &["decay", "segments", "clockwise"]),
// The grids' Tool Options: the dividers and switches the drag uses, the Default Size and
// Reference Point a click's dialog opens with.
diff --git a/crates/tools/src/three_point_arc.rs b/crates/tools/src/three_point_arc.rs
new file mode 100644
index 0000000000..60314cbe1f
--- /dev/null
+++ b/crates/tools/src/three_point_arc.rs
@@ -0,0 +1,337 @@
+//! The Three-Point Arc tool draws an open circular arc between two ends it is given
+//! (`shape.threePointArc`).
+//!
+//! The ends come first: a drag from one to the other, or a click on each. Shift keeps the second
+//! end at 45° steps from the first (from General › Constrain Angle). A third point then shapes the
+//! arc, placed by a click or by a press dragged to it: the arc passes through it, or, with the
+//! `direction` option on, the arc leaves the first end heading toward it (Alt: the arc arrives at
+//! the second end along the line from that end to the point, and Shift keeps the line at 45°
+//! steps). `direction` is set in the tool's Tool Options and kept with the preferences; `]` (with
+//! or without Shift) switches it while the ends are placed. Every point snaps to Smart Guides.
+//! Until the third point is placed, the tool shows the arc as a dashed outline with its ends, its
+//! center as a small cross, the direction line in direction mode and, with Measurement Labels on,
+//! the radius by the pointer. Where no arc fits (the third point lies on the line through the
+//! ends) or the arc would reach past the canvas, the tool shows "Arc too large" by the pointer
+//! (nothing while the pointer is on an end) and a click there draws nothing. The arc is one undo
+//! step. Escape, a press dropped part way, and an edit, Undo or Redo made outside the tool drop
+//! the ends; a second click on the first end (a double-click) places nothing.
+
+use serde_json::{Value, json};
+use vectorcraft_doc::MAX_COORD;
+use vectorcraft_geom::shapes::CircularArc;
+use vectorcraft_geom::{PathData, Point, Vec2};
+
+use crate::guides::{DrawSnap, Leave};
+use crate::{Action, Cursor, Mods, Overlay, PointerEvent, PointerKind, Tool, ToolContext, ToolKey};
+
+pub const ID: &str = "threePointArc";
+
+/// How far (screen points) the pointer travels from a press before the press counts as a drag.
+const DRAG_PX: f64 = 2.0;
+/// Half the length (screen points) of each arm of the cross at the arc's center.
+const CROSS_PX: f64 = 4.0;
+/// How near (screen points) the first end a second click counts as a click on it.
+const REACH_PX: f64 = 3.0;
+/// The label the tool shows by the pointer where no arc fits.
+pub const TOO_LARGE: &str = "Arc too large";
+
+/// The press in progress.
+#[derive(Clone, Copy, Debug, PartialEq)]
+enum Press {
+ /// The first end, placed at `at` by a press at `from` (before snapping): a release after a
+ /// drag places the second end there. The drag is measured from `from`.
+ Start { at: Point, from: Point, dragged: bool },
+ /// The second end, pressed after a click placed the first: the release places it.
+ End,
+ /// The third point, pressed once both ends are placed: the release draws the arc.
+ Third,
+}
+
+#[derive(Default)]
+pub struct ThreePointArcTool {
+ snap: DrawSnap,
+ /// The third point gives the arc's direction at an end instead of a point it passes through.
+ direction: bool,
+ start: Option,
+ end: Option,
+ press: Option,
+ /// Where the pointer is, snapped: the point the next press or release places.
+ pointer: Option,
+ /// Alt was held at the last pointer event: in direction mode, the direction is at the second end.
+ at_end: bool,
+ /// Where the pointer was at its last event, pressed or hovering, before snapping, and the keys
+ /// held then.
+ raw: Option<(Point, Mods)>,
+}
+
+/// The arc from `start` to `end` shaped by `third`, as `shape.threePointArc` draws it: through
+/// `third`, or with `direction`, heading toward `third` from `start` (or, with `at_end`, arriving
+/// at `end` along the line from `end` to `third`). None where no arc fits or the arc would reach
+/// past the canvas. With it, the path the command draws.
+pub fn arc_of(start: Point, end: Point, third: Point, direction: bool, at_end: bool) -> Option<(CircularArc, PathData)> {
+ let (arc, path) = match (direction, at_end) {
+ (false, _) => CircularArc::through(start, end, third).map(|arc| (arc, arc.to_path_via(third))),
+ (true, false) => CircularArc::leaving(start, third - start, end).map(|arc| (arc, arc.to_path())),
+ (true, true) => CircularArc::arriving(start, end, end - third).map(|arc| (arc, arc.to_path())),
+ }?;
+ // The curve is measured, not its handles, which can reach past the canvas while the curve stays
+ // inside, as the document's own range check measures a path.
+ let inside = |x: f64, y: f64| x.abs() <= MAX_COORD && y.abs() <= MAX_COORD;
+ let on_canvas = path.bounds().is_some_and(|r| inside(r.x0, r.y0) && inside(r.x1, r.y1));
+ on_canvas.then_some((arc, path))
+}
+
+/// The command the tool runs for the arc from `start` to `end` shaped by `third`.
+fn command(start: Point, end: Point, third: Point, direction: bool, at_end: bool) -> (String, Value) {
+ let pair = |p: Point| json!([p.x, p.y]);
+ let params = if direction {
+ json!({ "start": pair(start), "end": pair(end), "toward": pair(third), "at": if at_end { "end" } else { "start" } })
+ } else {
+ json!({ "start": pair(start), "end": pair(end), "through": pair(third) })
+ };
+ ("shape.threePointArc".into(), params)
+}
+
+impl ThreePointArcTool {
+ fn clear(&mut self) {
+ self.start = None;
+ self.end = None;
+ self.press = None;
+ self.pointer = None;
+ self.snap.clear();
+ }
+
+ /// How the point being placed keeps to the points before it: the second end to the first, and
+ /// in direction mode the third point to the end its direction line starts from.
+ fn leave(&self, cx: &ToolContext, mods: Mods) -> Option {
+ match (self.start, self.end) {
+ (Some(a), None) => Some(Leave::segment(cx, a, mods.shift)),
+ (Some(a), Some(b)) if self.direction => Some(Leave::segment(cx, if mods.alt { b } else { a }, mods.shift)),
+ _ => None,
+ }
+ }
+
+ /// The pressed pointer moved to `ev`, or Shift or Alt changed: the point being placed follows
+ /// it. A change of keys alone does not make the press a drag.
+ fn follow(&mut self, cx: &ToolContext, ev: &PointerEvent) {
+ let moved = self.raw.is_none_or(|(p, _)| p != ev.pos);
+ self.raw = Some((ev.pos, ev.mods));
+ match &mut self.press {
+ Some(Press::Start { at, from, dragged }) => {
+ *dragged |= moved && ev.pos.distance(*from) >= cx.tol(DRAG_PX);
+ let leave = Leave::segment(cx, *at, ev.mods.shift);
+ self.pointer = Some(self.snap.drag(cx, ev.pos, Some(&leave)));
+ }
+ Some(Press::End | Press::Third) => {
+ let leave = self.leave(cx, ev.mods);
+ self.pointer = Some(self.snap.drag(cx, ev.pos, leave.as_ref()));
+ }
+ None => {}
+ }
+ }
+
+ /// The arc as the tool shows it now, and its path: both ends placed and the pointer on a point
+ /// that fits.
+ fn arc(&self) -> Option<(CircularArc, PathData)> {
+ arc_of(self.start?, self.end?, self.pointer?, self.direction, self.at_end)
+ }
+}
+
+impl Tool for ThreePointArcTool {
+ fn id(&self) -> &'static str {
+ ID
+ }
+
+ fn pointer(&mut self, cx: &ToolContext, ev: &PointerEvent) -> Vec {
+ if !ev.pos.is_finite() {
+ return vec![];
+ }
+ if self.end.is_some() {
+ self.at_end = ev.mods.alt;
+ }
+ match ev.kind {
+ PointerKind::Move => {
+ self.raw = Some((ev.pos, ev.mods));
+ let leave = self.leave(cx, ev.mods);
+ self.pointer = Some(self.snap.hover(cx, ev.pos, &[], leave.as_ref()));
+ vec![]
+ }
+ PointerKind::Down => {
+ self.raw = Some((ev.pos, ev.mods));
+ let leave = self.leave(cx, ev.mods);
+ match (self.start, self.end) {
+ (None, _) => {
+ let at = self.snap.press(cx, ev.pos, &[], None);
+ self.start = Some(at);
+ self.press = Some(Press::Start { at, from: ev.pos, dragged: false });
+ self.pointer = Some(at);
+ }
+ (Some(a), None) => {
+ let at = self.snap.press(cx, ev.pos, &[], leave.as_ref());
+ // The second click of a double-click lands on the first end.
+ if at.distance(a) <= cx.tol(REACH_PX) {
+ self.press = None;
+ return vec![];
+ }
+ self.press = Some(Press::End);
+ self.pointer = Some(at);
+ }
+ (Some(_), Some(_)) => {
+ self.pointer = Some(self.snap.press(cx, ev.pos, &[], leave.as_ref()));
+ self.press = Some(Press::Third);
+ }
+ }
+ vec![]
+ }
+ PointerKind::Drag => {
+ self.follow(cx, ev);
+ vec![]
+ }
+ PointerKind::Up => {
+ // A release away from the last drag event places the point where it is let go, and
+ // a release with Shift or Alt changed places it as those keys keep it.
+ let same = self.raw.is_some_and(|(p, m)| p == ev.pos && (m.shift, m.alt) == (ev.mods.shift, ev.mods.alt));
+ if self.press.is_some() && !same {
+ self.follow(cx, ev);
+ }
+ match (self.press.take(), self.start, self.pointer) {
+ (Some(Press::Start { at, dragged: true, .. }), _, Some(b)) if b.distance(at) >= cx.tol(DRAG_PX) => self.end = Some(b),
+ (Some(Press::End), Some(a), Some(b)) if b.distance(a) > cx.tol(REACH_PX) => self.end = Some(b),
+ (Some(Press::Third), Some(a), Some(c)) => {
+ let Some(b) = self.end else { return vec![] };
+ // Where no arc fits, nothing is drawn and the ends stay for another try.
+ if self.arc().is_none() {
+ self.snap.clear();
+ return vec![];
+ }
+ let (name, params) = command(a, b, c, self.direction, self.at_end);
+ self.clear();
+ return vec![Action::Exec(name, params)];
+ }
+ _ => {}
+ }
+ // A placed end: the guides of the press go.
+ self.snap.clear();
+ vec![]
+ }
+ PointerKind::DoubleClick | PointerKind::TripleClick => vec![],
+ }
+ }
+
+ fn key(&mut self, cx: &ToolContext, key: ToolKey, _mods: Mods) -> Vec {
+ match key {
+ ToolKey::Escape => self.clear(),
+ ToolKey::BracketRight if self.start.is_some() => {
+ self.direction = !self.direction;
+ // A press in progress: the point being placed keeps to the new mode.
+ // A hovering pointer: the third point it shows keeps to the new mode too.
+ match (self.press, self.raw) {
+ (Some(_), Some((p, mods))) => self.follow(cx, &PointerEvent::new(PointerKind::Drag, p.x, p.y).with_mods(mods)),
+ (None, Some((p, mods))) if self.end.is_some() && self.pointer.is_some() => {
+ let leave = self.leave(cx, mods);
+ self.pointer = Some(self.snap.hover(cx, p, &[], leave.as_ref()));
+ }
+ _ => {}
+ }
+ }
+ _ => {}
+ }
+ vec![]
+ }
+
+ fn claims_key(&self, _cx: &ToolContext, key: ToolKey) -> bool {
+ matches!(key, ToolKey::Escape | ToolKey::BracketRight) && self.start.is_some()
+ }
+
+ /// An end placed: Escape drops it.
+ fn ends_on_escape(&self, _cx: &ToolContext) -> bool {
+ self.start.is_some()
+ }
+
+ fn busy(&self) -> bool {
+ self.start.is_some()
+ }
+
+ /// A dropped press (a second finger, a canceled touch) drops the ends placed so far.
+ fn drop_press(&mut self, _cx: &ToolContext) -> Vec {
+ self.clear();
+ vec![]
+ }
+
+ fn deactivate(&mut self, _cx: &ToolContext) -> Vec {
+ self.clear();
+ vec![]
+ }
+
+ fn hover_ended(&mut self, _cx: &ToolContext) {
+ if self.press.is_none() {
+ self.pointer = None;
+ self.snap.clear();
+ }
+ }
+
+ /// An edit, Undo or Redo made outside the tool, or another document, drops the ends.
+ fn history_moved(&mut self) {
+ self.clear();
+ }
+
+ fn overlays(&self, cx: &ToolContext) -> Vec {
+ let mut o = self.snap.guides().to_vec();
+ let color = crate::draw2::FEEDBACK;
+ match (self.start, self.end, self.pointer) {
+ // Placing the second end: the chord so far.
+ (Some(a), None, Some(b)) if b != a => o.push(Overlay::Line { a, b, color, dashed: true }),
+ (Some(a), Some(b), Some(p)) => {
+ if self.direction {
+ o.push(Overlay::Line { a: if self.at_end { b } else { a }, b: p, color, dashed: false });
+ }
+ match self.arc() {
+ Some((arc, path)) => {
+ o.push(Overlay::Path { path: path.to_bezpath(), color, width: 1.0, dashed: true });
+ let (c, arm) = (arc.center, cx.tol(CROSS_PX));
+ o.push(Overlay::Line { a: c - Vec2::new(arm, 0.0), b: c + Vec2::new(arm, 0.0), color, dashed: false });
+ o.push(Overlay::Line { a: c - Vec2::new(0.0, arm), b: c + Vec2::new(0.0, arm), color, dashed: false });
+ if cx.measurement_labels {
+ o.push(Overlay::Measure { p, text: format!("R: {}", cx.len(arc.radius)) });
+ }
+ }
+ // A pointer on an end gives no third point yet, so no label.
+ None if p.distance(a) <= cx.tol(REACH_PX) || p.distance(b) <= cx.tol(REACH_PX) => {}
+ None => o.push(Overlay::Label { p, text: TOO_LARGE.into(), color }),
+ }
+ }
+ _ => {}
+ }
+ for p in self.start.iter().chain(self.end.iter()) {
+ o.push(Overlay::Anchor { p: *p, color, filled: true, size: 6.0 });
+ }
+ o
+ }
+
+ fn cursor(&self, _cx: &ToolContext, _p: Point, _mods: Mods) -> Cursor {
+ Cursor::Crosshair
+ }
+
+ fn options(&self) -> Value {
+ json!({ "direction": self.direction })
+ }
+
+ fn set_option(&mut self, key: &str, value: &Value) {
+ if key == "direction"
+ && let Some(on) = value.as_bool()
+ {
+ self.direction = on;
+ }
+ }
+
+ fn check_option(&self, key: &str, v: &Value) -> Result<(), String> {
+ use crate::option_check as c;
+ match key {
+ "direction" => c::boolean(key, v),
+ _ => Err(c::unknown(key)),
+ }
+ }
+}
+
+#[cfg(test)]
+mod tests;
diff --git a/crates/tools/src/three_point_arc/tests.rs b/crates/tools/src/three_point_arc/tests.rs
new file mode 100644
index 0000000000..eaf269e974
--- /dev/null
+++ b/crates/tools/src/three_point_arc/tests.rs
@@ -0,0 +1,388 @@
+use super::*;
+use crate::testutil::*;
+use vectorcraft_doc::Selection;
+use vectorcraft_geom::Rect;
+
+fn ev(kind: PointerKind, (x, y): (f64, f64), mods: Mods) -> PointerEvent {
+ PointerEvent::new(kind, x, y).with_mods(mods)
+}
+
+fn click_with(t: &mut ThreePointArcTool, cx: &ToolContext, p: (f64, f64), mods: Mods) -> Vec {
+ let mut acts = t.pointer(cx, &ev(PointerKind::Down, p, mods));
+ acts.extend(t.pointer(cx, &ev(PointerKind::Up, p, mods)));
+ acts
+}
+
+fn click(t: &mut ThreePointArcTool, cx: &ToolContext, p: (f64, f64)) -> Vec {
+ click_with(t, cx, p, Mods::default())
+}
+
+fn hover(t: &mut ThreePointArcTool, cx: &ToolContext, p: (f64, f64), mods: Mods) {
+ assert!(t.pointer(cx, &ev(PointerKind::Move, p, mods)).is_empty());
+}
+
+/// A press at `from`, dragged through `path` and let go at its last point.
+fn drag(t: &mut ThreePointArcTool, cx: &ToolContext, from: (f64, f64), path: &[(f64, f64)], mods: Mods) -> Vec {
+ let mut acts = t.pointer(cx, &ev(PointerKind::Down, from, mods));
+ for p in path {
+ acts.extend(t.pointer(cx, &ev(PointerKind::Drag, *p, mods)));
+ }
+ let end = path.last().copied().unwrap_or(from);
+ acts.extend(t.pointer(cx, &ev(PointerKind::Up, end, mods)));
+ acts
+}
+
+fn through(start: (f64, f64), end: (f64, f64), via: (f64, f64)) -> Vec {
+ let pair = |(x, y): (f64, f64)| json!([x, y]);
+ vec![Action::Exec("shape.threePointArc".into(), json!({ "start": pair(start), "end": pair(end), "through": pair(via) }))]
+}
+
+fn toward(start: (f64, f64), end: (f64, f64), to: (f64, f64), at: &str) -> Vec {
+ let pair = |(x, y): (f64, f64)| json!([x, y]);
+ vec![Action::Exec("shape.threePointArc".into(), json!({ "start": pair(start), "end": pair(end), "toward": pair(to), "at": at }))]
+}
+
+/// The dashed arc the tool shows: its bounding box.
+fn preview(o: &[Overlay]) -> Option {
+ o.iter().find_map(|o| match o {
+ Overlay::Path { path, dashed: true, .. } => Some(vectorcraft_geom::Shape::bounding_box(path)),
+ _ => None,
+ })
+}
+
+fn too_large(o: &[Overlay]) -> bool {
+ o.iter().any(|o| matches!(o, Overlay::Label { text, .. } if text == TOO_LARGE))
+}
+
+/// A drag places the two ends; a click on a third point then draws the arc through it. Until
+/// then, nothing is drawn.
+#[test]
+fn a_drag_and_a_click_draw_the_arc_through_the_third_point() {
+ let (d, _) = doc_with_rect();
+ let (s, p) = (Selection::default(), paint());
+ let cx = ToolContext { smart_guides: false, ..cx(&d, &s, &p) };
+ let mut t = ThreePointArcTool::default();
+ assert!(drag(&mut t, &cx, (300.0, 300.0), &[(340.0, 300.0), (380.0, 300.0)], Mods::default()).is_empty());
+ assert!(t.busy() && t.ends_on_escape(&cx));
+ assert_eq!(click(&mut t, &cx, (340.0, 260.0)), through((300.0, 300.0), (380.0, 300.0), (340.0, 260.0)));
+ assert!(!t.busy() && t.overlays(&cx).is_empty(), "the tool starts afresh");
+}
+
+/// Two clicks place the ends. Between the second click and the third, the tool shows the arc
+/// through the pointer (a half circle here, bulging up the page), its center cross and its
+/// radius; the third click draws it.
+#[test]
+fn three_clicks_draw_the_arc_and_the_tool_shows_it_on_the_way() {
+ let (d, _) = doc_with_rect();
+ let (s, p) = (Selection::default(), paint());
+ let cx = ToolContext { smart_guides: false, ..cx(&d, &s, &p) };
+ let mut t = ThreePointArcTool::default();
+ assert!(click(&mut t, &cx, (300.0, 300.0)).is_empty());
+ hover(&mut t, &cx, (380.0, 300.0), Mods::default());
+ assert!(t.overlays(&cx).iter().any(|o| matches!(o, Overlay::Line { dashed: true, .. })), "the chord so far");
+ assert!(click(&mut t, &cx, (380.0, 300.0)).is_empty());
+ hover(&mut t, &cx, (340.0, 260.0), Mods::default());
+ let o = t.overlays(&cx);
+ let b = preview(&o).expect("the arc");
+ assert!((b.x0 - 300.0).abs() < 0.1 && (b.x1 - 380.0).abs() < 0.1 && (b.y0 - 260.0).abs() < 0.1 && (b.y1 - 300.0).abs() < 1e-9, "{b:?}");
+ let radius = format!("R: {}", cx.len(40.0));
+ assert!(o.iter().any(|o| matches!(o, Overlay::Measure { text, .. } if *text == radius)), "{o:?}");
+ // The center cross at (340, 300).
+ assert!(o.iter().any(|o| matches!(o, Overlay::Line { a, b, dashed: false, .. } if a.midpoint(*b).distance(Point::new(340.0, 300.0)) < 1e-9)));
+ let quiet = ToolContext { measurement_labels: false, ..cx };
+ assert!(!t.overlays(&quiet).iter().any(|o| matches!(o, Overlay::Measure { .. })));
+ assert_eq!(click(&mut t, &cx, (340.0, 260.0)), through((300.0, 300.0), (380.0, 300.0), (340.0, 260.0)));
+}
+
+/// A third point on the line through the ends, an arc reaching past the canvas, or a third point
+/// on an end gives no arc: a click draws nothing and keeps the ends, and a click on a point that
+/// fits then draws the arc. The tool shows "Arc too large" by the pointer, except on an end.
+#[test]
+fn a_third_point_in_line_with_the_ends_draws_nothing() {
+ let (d, _) = doc_with_rect();
+ let (s, p) = (Selection::default(), paint());
+ let cx = ToolContext { smart_guides: false, ..cx(&d, &s, &p) };
+ let mut t = ThreePointArcTool::default();
+ drag(&mut t, &cx, (300.0, 300.0), &[(380.0, 300.0)], Mods::default());
+ // Nearly in line beyond the end: the circle's center is about 1.2·10⁷ pt away.
+ for (bad, label) in [((420.0, 300.0), true), ((250.0, 300.0), true), ((340.0, 300.0), true), ((500.0, 300.001), true), ((380.0, 300.0), false)] {
+ hover(&mut t, &cx, bad, Mods::default());
+ let o = t.overlays(&cx);
+ assert!(too_large(&o) == label && preview(&o).is_none(), "{bad:?}: {o:?}");
+ assert!(click(&mut t, &cx, bad).is_empty(), "{bad:?}");
+ assert!(t.busy());
+ }
+ assert_eq!(click(&mut t, &cx, (340.0, 340.0)), through((300.0, 300.0), (380.0, 300.0), (340.0, 340.0)));
+}
+
+/// An arc near the canvas edge fits while its curve stays inside, even where a handle reaches past
+/// the edge, and gives no arc once the curve reaches past it.
+#[test]
+fn an_arc_near_the_canvas_edge_is_measured_by_its_curve() {
+ // A 60° arc of radius 1000 whose rightmost point is `edge`: the handles at its ends reach about
+ // 45 pt further right.
+ let arc = |edge: f64| {
+ let (r, c) = (1000.0, edge - 1000.0);
+ let (dx, dy) = (r * 30f64.to_radians().cos(), r * 30f64.to_radians().sin());
+ let start = Point::new(c + dx, -dy);
+ let end = Point::new(c + dx, dy);
+ arc_of(start, end, start + Vec2::new(0.5, 3f64.sqrt() / 2.0) * 100.0, true, false)
+ };
+ let Some((_, path)) = arc(MAX_COORD - 1.0) else { panic!("an arc inside the canvas fits") };
+ assert!(path.control_bounds().is_some_and(|r| r.x1 > MAX_COORD), "a handle reaches past the edge");
+ assert!(path.bounds().is_some_and(|r| r.x1 <= MAX_COORD && (r.x1 - (MAX_COORD - 1.0)).abs() < 1e-6));
+ assert!(arc(MAX_COORD + 1.0).is_none(), "an arc reaching past the canvas does not fit");
+}
+
+/// In direction mode, Shift keeps the direction line at 45° steps from the end it starts at.
+#[test]
+fn shift_keeps_the_direction_at_45_degree_steps() {
+ let (d, _) = doc_with_rect();
+ let (s, p) = (Selection::default(), paint());
+ let cx = ToolContext { smart_guides: false, ..cx(&d, &s, &p) };
+ let mut t = ThreePointArcTool::default();
+ t.set_option("direction", &json!(true));
+ drag(&mut t, &cx, (300.0, 300.0), &[(380.0, 300.0)], Mods::default());
+ let shift = Mods { shift: true, ..Mods::default() };
+ let acts = click_with(&mut t, &cx, (303.0, 250.0), shift);
+ let [Action::Exec(_, params)] = acts.as_slice() else { panic!("{acts:?}") };
+ assert!(params["toward"][0].as_f64().is_some_and(|x| (x - 300.0).abs() < 1e-9), "{params}");
+ // With Alt, from the second end.
+ drag(&mut t, &cx, (300.0, 300.0), &[(380.0, 300.0)], Mods::default());
+ let both = Mods { shift: true, alt: true, ..Mods::default() };
+ let acts = click_with(&mut t, &cx, (383.0, 250.0), both);
+ let [Action::Exec(_, params)] = acts.as_slice() else { panic!("{acts:?}") };
+ assert!(params["toward"][0].as_f64().is_some_and(|x| (x - 380.0).abs() < 1e-9) && params["at"] == "end", "{params}");
+}
+
+/// With the `direction` option, the third point gives the direction the arc leaves its first
+/// end in, and the tool shows the line from that end to the pointer. Alt moves the direction to
+/// the second end. `]` switches the option while the ends are placed, and only then.
+#[test]
+fn in_direction_mode_the_third_point_sets_the_tangent_at_an_end() {
+ let (d, _) = doc_with_rect();
+ let (s, p) = (Selection::default(), paint());
+ let cx = ToolContext { smart_guides: false, ..cx(&d, &s, &p) };
+ let mut t = ThreePointArcTool::default();
+ assert!(!t.claims_key(&cx, ToolKey::BracketRight), "no ends: ] is left to the app");
+ t.key(&cx, ToolKey::BracketRight, Mods::default());
+ assert_eq!(t.options(), json!({ "direction": false }));
+ drag(&mut t, &cx, (300.0, 300.0), &[(380.0, 300.0)], Mods::default());
+ assert!(t.claims_key(&cx, ToolKey::BracketRight));
+ t.key(&cx, ToolKey::BracketRight, Mods::default());
+ assert_eq!(t.options(), json!({ "direction": true }));
+ // Straight up the page from (300, 300): the upper half circle about (340, 300).
+ hover(&mut t, &cx, (300.0, 250.0), Mods::default());
+ let o = t.overlays(&cx);
+ let b = preview(&o).expect("the arc");
+ assert!((b.y0 - 260.0).abs() < 0.1 && (b.y1 - 300.0).abs() < 1e-9, "{b:?}");
+ // The direction line: solid, from the end it starts at.
+ let line = |o: &[Overlay], from: Point| o.iter().any(|o| matches!(o, Overlay::Line { a, dashed: false, .. } if *a == from));
+ assert!(line(&o, Point::new(300.0, 300.0)), "{o:?}");
+ assert_eq!(click(&mut t, &cx, (300.0, 250.0)), toward((300.0, 300.0), (380.0, 300.0), (300.0, 250.0), "start"));
+ // Alt: the direction line starts at the second end.
+ t.set_option("direction", &json!(true));
+ drag(&mut t, &cx, (300.0, 300.0), &[(380.0, 300.0)], Mods::default());
+ let alt = Mods { alt: true, ..Mods::default() };
+ hover(&mut t, &cx, (380.0, 250.0), alt);
+ assert!(line(&t.overlays(&cx), Point::new(380.0, 300.0)));
+ assert!(preview(&t.overlays(&cx)).is_some());
+ assert_eq!(click_with(&mut t, &cx, (380.0, 250.0), alt), toward((300.0, 300.0), (380.0, 300.0), (380.0, 250.0), "end"));
+ // ] switches back to passing through the third point.
+ drag(&mut t, &cx, (300.0, 300.0), &[(380.0, 300.0)], Mods::default());
+ t.key(&cx, ToolKey::BracketRight, Mods::default());
+ assert_eq!(click(&mut t, &cx, (340.0, 260.0)), through((300.0, 300.0), (380.0, 300.0), (340.0, 260.0)));
+}
+
+/// The `direction` option takes a bool; anything else leaves it as it was.
+#[test]
+fn the_direction_option_takes_a_bool() {
+ let mut t = ThreePointArcTool::default();
+ t.set_option("direction", &json!(true));
+ for v in [json!("false"), json!(0), json!(null)] {
+ t.set_option("direction", &v);
+ assert_eq!(t.options(), json!({ "direction": true }), "{v}");
+ }
+ t.set_option("direction", &json!(false));
+ assert_eq!(t.options(), json!({ "direction": false }));
+}
+
+/// `]` pressed while the third point is held down places the point as the new mode keeps it: the
+/// point Shift kept on the direction line goes back to where the pointer is, and the other way.
+#[test]
+fn bracket_during_a_press_places_the_third_point_in_the_new_mode() {
+ let (d, _) = doc_with_rect();
+ let (s, p) = (Selection::default(), paint());
+ let cx = ToolContext { smart_guides: false, ..cx(&d, &s, &p) };
+ let mut t = ThreePointArcTool::default();
+ let shift = Mods { shift: true, ..Mods::default() };
+ t.set_option("direction", &json!(true));
+ drag(&mut t, &cx, (300.0, 300.0), &[(380.0, 300.0)], Mods::default());
+ t.pointer(&cx, &ev(PointerKind::Down, (303.0, 250.0), shift));
+ t.key(&cx, ToolKey::BracketRight, Mods::default());
+ assert_eq!(t.pointer(&cx, &ev(PointerKind::Up, (303.0, 250.0), shift)), through((300.0, 300.0), (380.0, 300.0), (303.0, 250.0)));
+ // Through mode first, switched to direction mode during the press: Shift keeps the line upright.
+ drag(&mut t, &cx, (300.0, 300.0), &[(380.0, 300.0)], Mods::default());
+ t.pointer(&cx, &ev(PointerKind::Down, (303.0, 250.0), shift));
+ t.key(&cx, ToolKey::BracketRight, Mods::default());
+ let acts = t.pointer(&cx, &ev(PointerKind::Up, (303.0, 250.0), shift));
+ let [Action::Exec(_, params)] = acts.as_slice() else { panic!("{acts:?}") };
+ assert!(params["toward"][0].as_f64().is_some_and(|x| (x - 300.0).abs() < 1e-9) && params["at"] == "start", "{params}");
+}
+
+/// `]` pressed while the pointer hovers moves the third point the tool shows to where the new mode
+/// keeps it, so the arc shown is the arc a click there draws.
+#[test]
+fn bracket_while_hovering_shows_the_third_point_in_the_new_mode() {
+ let (d, _) = doc_with_rect();
+ let (s, p) = (Selection::default(), paint());
+ let cx = ToolContext { smart_guides: false, ..cx(&d, &s, &p) };
+ let mut t = ThreePointArcTool::default();
+ let shift = Mods { shift: true, ..Mods::default() };
+ drag(&mut t, &cx, (300.0, 300.0), &[(380.0, 300.0)], Mods::default());
+ hover(&mut t, &cx, (303.0, 250.0), shift);
+ t.key(&cx, ToolKey::BracketRight, Mods::default());
+ // The direction line from the first end: Shift keeps it upright.
+ let start = Point::new(300.0, 300.0);
+ let line = t.overlays(&cx).into_iter().find_map(|o| match o {
+ Overlay::Line { a, b, dashed: false, .. } if a == start => Some(b),
+ _ => None,
+ });
+ assert!(line.is_some_and(|b| (b.x - 300.0).abs() < 1e-9), "{line:?}");
+ let acts = click_with(&mut t, &cx, (303.0, 250.0), shift);
+ let [Action::Exec(_, params)] = acts.as_slice() else { panic!("{acts:?}") };
+ assert!(params["toward"][0].as_f64().is_some_and(|x| (x - 300.0).abs() < 1e-9), "{params}");
+ // Back to through mode while hovering: the point goes back to the pointer.
+ drag(&mut t, &cx, (300.0, 300.0), &[(380.0, 300.0)], Mods::default());
+ hover(&mut t, &cx, (303.0, 250.0), shift);
+ assert!(t.pointer.is_some_and(|q| (q.x - 300.0).abs() < 1e-9), "{:?}", t.pointer);
+ t.key(&cx, ToolKey::BracketRight, Mods::default());
+ assert_eq!(t.pointer, Some(Point::new(303.0, 250.0)));
+ assert_eq!(click_with(&mut t, &cx, (303.0, 250.0), shift), through((300.0, 300.0), (380.0, 300.0), (303.0, 250.0)));
+}
+
+/// With Snap to Point, a first press that snaps to the rectangle's corner, 1.5 pt from the
+/// pointer, and moves 1.9 pt before it is let go is a click: the drag is measured from the press,
+/// not from the corner, so only the first end is placed.
+#[test]
+fn a_short_move_from_a_snapped_press_is_not_a_drag() {
+ let (d, _) = doc_with_rect();
+ let (s, p) = (Selection::default(), paint());
+ let cx = ToolContext { smart_guides: false, snap_to_point: true, ..cx(&d, &s, &p) };
+ let mut t = ThreePointArcTool::default();
+ t.pointer(&cx, &ev(PointerKind::Down, (201.5, 200.0), Mods::default()));
+ t.pointer(&cx, &ev(PointerKind::Drag, (203.4, 200.0), Mods::default()));
+ t.pointer(&cx, &ev(PointerKind::Up, (203.4, 200.0), Mods::default()));
+ assert_eq!((t.start, t.end), (Some(Point::new(200.0, 200.0)), None));
+}
+
+/// A release away from the last drag event places the point where the pointer is let go, for
+/// the second end and for the third point.
+#[test]
+fn a_point_is_placed_where_the_press_is_let_go() {
+ let (d, _) = doc_with_rect();
+ let (s, p) = (Selection::default(), paint());
+ let cx = ToolContext { smart_guides: false, ..cx(&d, &s, &p) };
+ let mut t = ThreePointArcTool::default();
+ let none = Mods::default();
+ t.pointer(&cx, &ev(PointerKind::Down, (300.0, 300.0), none));
+ t.pointer(&cx, &ev(PointerKind::Drag, (340.0, 300.0), none));
+ t.pointer(&cx, &ev(PointerKind::Up, (380.0, 300.0), none));
+ assert_eq!(t.end, Some(Point::new(380.0, 300.0)));
+ t.pointer(&cx, &ev(PointerKind::Down, (340.0, 250.0), none));
+ assert_eq!(t.pointer(&cx, &ev(PointerKind::Up, (340.0, 260.0), none)), through((300.0, 300.0), (380.0, 300.0), (340.0, 260.0)));
+ // A press that only moves when it is let go still counts as a drag for the ends.
+ t.pointer(&cx, &ev(PointerKind::Down, (300.0, 300.0), none));
+ t.pointer(&cx, &ev(PointerKind::Up, (380.0, 300.0), none));
+ assert_eq!(t.end, Some(Point::new(380.0, 300.0)));
+}
+
+/// A release with Shift or Alt changed since the press places the point as the keys at the
+/// release keep it, even where the pointer did not move.
+#[test]
+fn a_release_places_the_point_with_the_keys_held_then() {
+ let (d, _) = doc_with_rect();
+ let (s, p) = (Selection::default(), paint());
+ let cx = ToolContext { smart_guides: false, ..cx(&d, &s, &p) };
+ let mut t = ThreePointArcTool::default();
+ let (none, shift) = (Mods::default(), Mods { shift: true, ..Mods::default() });
+ // The second end: pressed without Shift, let go with it.
+ click(&mut t, &cx, (300.0, 300.0));
+ t.pointer(&cx, &ev(PointerKind::Down, (380.0, 306.0), none));
+ t.pointer(&cx, &ev(PointerKind::Up, (380.0, 306.0), shift));
+ assert_eq!(t.end.map(|e| e.y), Some(300.0), "{:?}", t.end);
+ // The third point in direction mode: pressed with Shift, let go with Shift and Alt, so the
+ // direction line keeps to 45° steps from the second end.
+ t.set_option("direction", &json!(true));
+ let both = Mods { alt: true, ..shift };
+ t.pointer(&cx, &ev(PointerKind::Down, (303.0, 250.0), shift));
+ let acts = t.pointer(&cx, &ev(PointerKind::Up, (303.0, 250.0), both));
+ let [Action::Exec(_, params)] = acts.as_slice() else { panic!("{acts:?}") };
+ let at = |key: &str, i: usize| params[key][i].as_f64().unwrap_or(f64::NAN);
+ let (dx, dy) = (at("toward", 0) - at("end", 0), at("toward", 1) - at("end", 1));
+ assert!(params["at"] == "end" && (dx.abs() - dy.abs()).abs() < 1e-9, "{params}");
+}
+
+/// A first click that snaps to the rectangle's corner, 3 pt from the pointer, and is let go with
+/// Shift changed places only the first end: a change of keys alone is not a drag.
+#[test]
+fn a_click_let_go_with_shift_changed_is_not_a_drag() {
+ let (d, _) = doc_with_rect();
+ let (s, p) = (Selection::default(), paint());
+ let cx = cx(&d, &s, &p);
+ let g = Point::new(200.0, 200.0);
+ let off = (203.0, 201.0);
+ let mut t = ThreePointArcTool::default();
+ t.pointer(&cx, &ev(PointerKind::Down, off, Mods::default()));
+ t.pointer(&cx, &ev(PointerKind::Up, off, Mods { shift: true, ..Mods::default() }));
+ assert_eq!((t.start, t.end), (Some(g), None));
+}
+
+/// Shift keeps the second end at 45° steps from the first.
+#[test]
+fn shift_keeps_the_second_end_at_45_degree_steps() {
+ let (d, _) = doc_with_rect();
+ let (s, p) = (Selection::default(), paint());
+ let cx = ToolContext { smart_guides: false, ..cx(&d, &s, &p) };
+ let mut t = ThreePointArcTool::default();
+ let shift = Mods { shift: true, ..Mods::default() };
+ drag(&mut t, &cx, (300.0, 300.0), &[(340.0, 303.0), (380.0, 306.0)], shift);
+ assert_eq!(t.end.map(|e| e.y), Some(300.0), "{:?}", t.end);
+}
+
+/// Escape, an edit made outside the tool and a dropped press drop the ends; a second click on
+/// the first end (a double-click) places nothing.
+#[test]
+fn escape_history_and_a_double_click_drop_or_keep_the_ends() {
+ let (d, _) = doc_with_rect();
+ let (s, p) = (Selection::default(), paint());
+ let cx = ToolContext { smart_guides: false, ..cx(&d, &s, &p) };
+ let mut t = ThreePointArcTool::default();
+ click(&mut t, &cx, (300.0, 300.0));
+ assert!(t.claims_key(&cx, ToolKey::Escape));
+ t.key(&cx, ToolKey::Escape, Mods::default());
+ assert!(!t.busy() && !t.claims_key(&cx, ToolKey::Escape));
+ click(&mut t, &cx, (300.0, 300.0));
+ assert!(click(&mut t, &cx, (300.5, 300.0)).is_empty());
+ assert_eq!((t.start, t.end), (Some(Point::new(300.0, 300.0)), None), "the double-click's second click places nothing");
+ click(&mut t, &cx, (380.0, 300.0));
+ t.history_moved();
+ assert!(!t.busy());
+ drag(&mut t, &cx, (300.0, 300.0), &[(380.0, 300.0)], Mods::default());
+ t.drop_press(&cx);
+ assert!(!t.busy() && t.overlays(&cx).is_empty());
+}
+
+/// The catalog lists the tool in the Line Segment tool's group, after the Arc tool, with no
+/// default shortcut, and `create` makes it.
+#[test]
+fn the_tool_is_in_the_line_segment_group_after_the_arc_tool() {
+ let group = crate::TOOL_GROUPS.iter().find(|g| g.iter().any(|t| t.id == ID)).expect("in a toolbar group");
+ let ids: Vec<_> = group.iter().map(|t| t.id).collect();
+ let arc = ids.iter().position(|id| *id == "arc").expect("the Arc tool's group");
+ assert_eq!(ids.first(), Some(&"lineSegment"));
+ assert_eq!(ids.get(arc + 1), Some(&ID));
+ let info = crate::tool_info(ID).expect("catalogued");
+ assert_eq!((info.label, info.shortcut), ("Three-Point Arc Tool", None));
+ assert_eq!(crate::create(ID).id(), ID);
+}
diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs
index 0d4dbe1ebf..1f34a72f9a 100644
--- a/crates/ui-egui/src/dialogs.rs
+++ b/crates/ui-egui/src/dialogs.rs
@@ -150,6 +150,7 @@ mod text_export;
pub mod text_import;
mod three_d_classic;
pub(crate) mod three_d_materials;
+pub mod three_point_arc_options;
mod tiff_bmp_tga;
pub mod tile_edge_color;
mod tools;
@@ -471,6 +472,7 @@ registry! {
FreehandOptions: [freehand::KIND] => freehand::SPEC,
ShapeBuilderOptions: [shape_builder_options::KIND] => shape_builder_options::SPEC,
ObjectsOnPathOptions: [objects_on_path_options::KIND] => objects_on_path_options::SPEC,
+ ThreePointArcOptions: [three_point_arc_options::KIND] => three_point_arc_options::SPEC,
FlareOptions: [flare_options::KIND] => flare_options::SPEC,
SymbolOptions: [symbol_options::KIND] => symbol_options::SPEC,
DeleteSymbol: [symbol_delete::KIND] => symbol_delete::SPEC,
diff --git a/crates/ui-egui/src/dialogs/three_point_arc_options.rs b/crates/ui-egui/src/dialogs/three_point_arc_options.rs
new file mode 100644
index 0000000000..6d0eee96d1
--- /dev/null
+++ b/crates/ui-egui/src/dialogs/three_point_arc_options.rs
@@ -0,0 +1,84 @@
+//! Three-Point Arc Tool Options (double-click the Three-Point Arc tool, or `tool.options`):
+//! Third Point Sets Direction, the tool's `direction` option. With it on, the third point gives the
+//! direction the arc leaves an end in; with it off, the arc passes through the third point. OK
+//! sets it with `tool.setOption {tool: "threePointArc", values: {direction}}`; it lasts across
+//! tool switches and is saved with the preferences. `]` also switches it while an arc is drawn.
+
+use serde_json::{Map, Value, json};
+use vectorcraft_tools::three_point_arc::ID as TOOL;
+
+use super::{DialogSpec, run_and_close};
+use crate::state::Dialog;
+use crate::{VectorcraftApp, widgets};
+
+/// The dialog kind of Three-Point Arc Tool Options.
+pub const KIND: &str = "threePointArcOptions";
+
+pub(super) const SPEC: DialogSpec = DialogSpec { heading, body, confirm, min_width: 280.0, ..DialogSpec::FORM };
+
+fn heading(_: &Dialog) -> String {
+ let label = vectorcraft_tools::tool_info(TOOL).map_or("", |t| t.label);
+ crate::i18n::fmt(tl!("{tool} Options"), &[("tool", tl!(label))])
+}
+
+/// Open the tool's options with their current values.
+pub fn open(app: &mut VectorcraftApp) -> Value {
+ let on = app.session.tool_options_of(TOOL).get("direction").and_then(Value::as_bool).unwrap_or(false);
+ let mut fields = Map::new();
+ fields.insert("direction".into(), json!(on));
+ app.ui.dialog = Some(Dialog { kind: KIND.into(), fields });
+ json!({ "dialog": KIND })
+}
+
+fn body(_app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool {
+ let on = d.bool("direction");
+ if widgets::check(ui, tl!("Third Point Sets Direction"), on, true) {
+ d.fields.insert("direction".into(), json!(!on));
+ }
+ false
+}
+
+/// OK: set the tool's `direction`.
+fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result {
+ run_and_close(app, "tool.setOption", json!({ "tool": TOOL, "values": { "direction": d.bool("direction") } }))
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+ use vectorcraft_engine::Session;
+
+ fn app() -> VectorcraftApp {
+ let mut app = VectorcraftApp::new(Session::new(), Default::default());
+ app.run("file.new", json!({"width": 400, "height": 400})).unwrap();
+ app
+ }
+
+ /// The labels the open dialog paints.
+ fn painted(app: &mut VectorcraftApp) -> String {
+ crate::tests_labels::painted_text(app, |app, ui| super::super::show(app, ui.ctx()))
+ }
+
+ #[test]
+ fn double_clicking_the_tool_opens_its_options_and_ok_sets_the_direction() {
+ let mut app = app();
+ assert_eq!(app.session.tool_options_of(TOOL)["direction"], json!(false));
+ let r = app.run("tool.options", json!({"tool": TOOL})).unwrap();
+ assert_eq!(r["dialog"], json!(KIND));
+ let text = painted(&mut app);
+ for label in ["Three-Point Arc Tool Options", "Third Point Sets Direction", "OK", "Cancel"] {
+ assert!(text.contains(label), "{label} in {text}");
+ }
+ let d = app.ui.dialog.as_mut().unwrap();
+ assert!(!d.bool("direction"));
+ d.fields.insert("direction".into(), json!(true));
+ super::super::confirm(&mut app).unwrap();
+ assert!(app.ui.dialog.is_none());
+ assert_eq!(app.session.tool_options_of(TOOL)["direction"], json!(true));
+ // It lasts while another tool is chosen, and the dialog opens on it again.
+ app.select_tool(TOOL);
+ app.select_tool("selection");
+ app.run("tool.options", json!({"tool": TOOL})).unwrap();
+ assert!(app.ui.dialog.as_ref().unwrap().bool("direction"));
+ }
+}
diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv
index e11cefc8e9..e97c0fd810 100644
--- a/crates/ui-egui/src/i18n/bg.tsv
+++ b/crates/ui-egui/src/i18n/bg.tsv
@@ -126,6 +126,7 @@
Add to Selection Добавяне към селекцията
Add to Swatches Добавяне към образци
Add Used Colors Добавяне на използваните цветове
+ Add Selected Colors Добавяне на избраните цветове
Additional Plug-ins Folder Допълнителна папка за плъгини
Plug-in Instruction Budget Бюджет на инструкции за плъгини
Additional Fonts Folder Допълнителна папка за шрифтове
@@ -223,6 +224,10 @@ font-technology Variable Променливи
Arc Дъга
Arc Lower… Дъга надолу…
Arc Tool Инструмент „Дъга“
+ Three-Point Arc Tool Инструмент „Дъга през три точки“
+ Three-Point Arc Дъга през три точки
+ Arc too large Дъгата е твърде голяма
+ Third Point Sets Direction Третата точка задава посоката
Arc Upper… Дъга нагоре…
Arch… Извиване…
Arc… Дъга…
@@ -7884,6 +7889,10 @@ breakText Glyphs Глифи
@msg A joint does not close by {gap} pt. Една връзка не се затваря с {gap} pt.
@msg Two panels pass through each other. Два панела минават един през друг.
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer трябва да е "singleLine", "everyLine", "standardSingleLine" или "standardEveryLine"
+@msg `at` must be "start" or "end" `at` трябва да е "start" или "end"
+@msg give exactly one of `through` and `toward` посочете точно едно от `through` и `toward`
+@msg no arc fits these points: two are the same or all three lie on one line няма дъга през тези точки: две съвпадат или и трите лежат на една права
+@msg give `at` only with `toward` задайте `at` само заедно с `toward`
Engraving Гравюра
Fine Hatching Фино щриховане
Dense Hatching Гъсто щриховане
diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv
index e3d8c2cd9a..0629e5cf74 100644
--- a/crates/ui-egui/src/i18n/bs.tsv
+++ b/crates/ui-egui/src/i18n/bs.tsv
@@ -1506,6 +1506,10 @@ lighting Light Svjetlo
Add Anchor Point Tool Alat za dodavanje sidrene tačke
Anchor Point Tool Alat sidrena tačka
Arc Tool Alat luk
+ Three-Point Arc Tool Alat luk kroz tri tačke
+ Three-Point Arc Luk kroz tri tačke
+ Arc too large Luk je prevelik
+ Third Point Sets Direction Treća tačka određuje smjer
Area Graph Tool Alat za površinski grafikon
Area Type Tool Alat za tekst u području
Artboard Tool Alat radna ploča
@@ -4340,6 +4344,7 @@ theme Appearance Izgled
Add to Graphic Styles Dodaj u grafičke stilove
Graphic Style Library Biblioteka grafičkih stilova
Add Used Colors Dodaj korištene boje
+ Add Selected Colors Dodaj odabrane boje
Delete Swatch Izbriši uzorak boje
Duplicate Swatch Dupliciraj uzorak boje
Merge Swatches Spoji uzorke boja
@@ -7939,6 +7944,10 @@ shape Open Otvoren
@msg A joint does not close by {gap} pt. Spoj se ne zatvara za {gap} pt.
@msg Two panels pass through each other. Dva panela prolaze jedan kroz drugi.
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer mora biti "singleLine", "everyLine", "standardSingleLine" ili "standardEveryLine"
+@msg `at` must be "start" or "end" `at` mora biti "start" ili "end"
+@msg give exactly one of `through` and `toward` navedite tačno jedno od `through` i `toward`
+@msg no arc fits these points: two are the same or all three lie on one line nijedan luk ne odgovara ovim tačkama: dvije su iste ili sve tri leže na jednoj pravoj
+@msg give `at` only with `toward` navedite `at` samo uz `toward`
Engraving Gravura
Fine Hatching Fino šrafiranje
Dense Hatching Gusto šrafiranje
diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv
index 4d085e7bf3..81684c7d67 100644
--- a/crates/ui-egui/src/i18n/ca.tsv
+++ b/crates/ui-egui/src/i18n/ca.tsv
@@ -221,6 +221,7 @@
Add to Symbols Afegeix als símbols
Add to the Current Shortcuts Afegeix a les dreceres actuals
Add Used Colors Afegeix els colors utilitzats
+ Add Selected Colors Afegeix els colors seleccionats
Additional Fonts Folder Carpeta addicional de tipus de lletra
Additional Plug-ins Folder Carpeta addicional de complements
Plug-in Instruction Budget Pressupost d’instruccions dels complements
@@ -344,6 +345,10 @@ antiAlias Sharp Nítid
Arc Lower… Arc inferior…
Arc Segment Tool Options Opcions de l’eina de segment d’arc
Arc Tool Eina d’arc
+ Three-Point Arc Tool Eina d’arc per tres punts
+ Three-Point Arc Arc per tres punts
+ Arc too large Arc massa gran
+ Third Point Sets Direction El tercer punt indica la direcció
Arc Upper… Arc superior…
Arch… Arqueja…
Arc… Arc…
@@ -6800,6 +6805,10 @@ liquify-list-end {0}, {1} {0} i {1}
@msg a guide has no curvature circle una guia no té cercle de curvatura
@msg the circle that matches the path there would reach past the canvas el cercle que coincideix amb el traçat en aquest punt sortiria del llenç
@msg no circle passes through these points: two are the same or all three lie on one line cap cercle no passa per aquests punts: dos són iguals o tots tres són en una mateixa recta
+@msg `at` must be "start" or "end" `at` ha de ser "start" o "end"
+@msg give exactly one of `through` and `toward` indiqueu exactament un de `through` i `toward`
+@msg no arc fits these points: two are the same or all three lie on one line cap arc no s’ajusta a aquests punts: dos són iguals o tots tres són en una mateixa recta
+@msg give `at` only with `toward` indiqueu `at` només amb `toward`
@msg no app to open files here aquí no hi ha cap aplicació per obrir fitxers
@msg no artboard no hi ha tauler
@msg no artboard {i} (0-based; the document has {_1}) no hi ha el tauler {i} (basat en 0; el document en té {_1})
diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv
index fa043a2e6f..bda096c894 100644
--- a/crates/ui-egui/src/i18n/cs.tsv
+++ b/crates/ui-egui/src/i18n/cs.tsv
@@ -1531,6 +1531,10 @@ lighting Light Světlo
Add Anchor Point Tool Nástroj Přidat kotevní bod
Anchor Point Tool Nástroj Kotevní bod
Arc Tool Nástroj Oblouk
+ Three-Point Arc Tool Nástroj Oblouk třemi body
+ Three-Point Arc Oblouk třemi body
+ Arc too large Oblouk je příliš velký
+ Third Point Sets Direction Třetí bod určuje směr
Area Graph Tool Nástroj Plošný graf
Area Type Tool Nástroj Text v oblasti
Artboard Tool Nástroj Pracovní plocha
@@ -4449,6 +4453,7 @@ theme Appearance Motiv
Add to Graphic Styles Přidat do grafických stylů
Graphic Style Library Knihovna grafických stylů
Add Used Colors Přidat použité barvy
+ Add Selected Colors Přidat vybrané barvy
Delete Swatch Odstranit položku vzorníku
Duplicate Swatch Duplikovat položku vzorníku
Merge Swatches Sloučit položky vzorníku
@@ -5687,6 +5692,10 @@ liquify-list-end {0}, {1} {0} a {1}
@msg a guide has no curvature circle vodítko nemá kružnici křivosti
@msg the circle that matches the path there would reach past the canvas kružnice odpovídající cestě v tomto místě by přesáhla plátno
@msg no circle passes through these points: two are the same or all three lie on one line těmito body neprochází žádná kružnice: dva jsou stejné nebo všechny tři leží na jedné přímce
+@msg `at` must be "start" or "end" `at` musí být "start" nebo "end"
+@msg give exactly one of `through` and `toward` zadejte právě jeden z parametrů `through` a `toward`
+@msg no arc fits these points: two are the same or all three lie on one line těmto bodům neodpovídá žádný oblouk: dva jsou stejné nebo všechny tři leží na jedné přímce
+@msg give `at` only with `toward` parametr `at` zadejte jen s `toward`
@msg no app to open files here zde chybí aplikace pro otevírání souborů
@msg no artboard žádná pracovní plocha
@msg no artboard {i} (0-based; the document has {_1}) pracovní plocha {i} neexistuje (číslováno od 0; dokument jich má {_1})
diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv
index ec4092e9aa..55c1424be3 100644
--- a/crates/ui-egui/src/i18n/da.tsv
+++ b/crates/ui-egui/src/i18n/da.tsv
@@ -4184,6 +4184,10 @@ lighting Light Lys
Add Anchor Point Tool Tilføj ankerpunkt-værktøj
Anchor Point Tool Ankerpunktværktøj
Arc Tool Bueværktøj
+ Three-Point Arc Tool Værktøj til bue gennem tre punkter
+ Three-Point Arc Bue gennem tre punkter
+ Arc too large Buen er for stor
+ Third Point Sets Direction Tredje punkt angiver retningen
Area Graph Tool Områdediagramværktøj
Area Type Tool Områdetekstværktøj
Artboard Tool Tegnebrætværktøj
@@ -6903,6 +6907,7 @@ theme Appearance Udseende
Add to Graphic Styles Føj til grafikstile
Graphic Style Library Grafikstilbibliotek
Add Used Colors Tilføj anvendte farver
+ Add Selected Colors Tilføj valgte farver
Delete Swatch Slet farveprøve
Duplicate Swatch Duplikér farveprøve
Merge Swatches Flet farveprøver
@@ -7883,6 +7888,10 @@ imageTrace Outline Kontur
@msg a guide has no curvature circle en hjælpelinje har ingen krumningscirkel
@msg the circle that matches the path there would reach past the canvas cirklen, der passer til kurven der, ville gå ud over lærredet
@msg no circle passes through these points: two are the same or all three lie on one line ingen cirkel går gennem disse punkter: to er ens, eller alle tre ligger på én linje
+@msg `at` must be "start" or "end" `at` skal være "start" eller "end"
+@msg give exactly one of `through` and `toward` angiv præcis én af `through` og `toward`
+@msg no arc fits these points: two are the same or all three lie on one line ingen bue passer til disse punkter: to er ens, eller alle tre ligger på én linje
+@msg give `at` only with `toward` angiv kun `at` sammen med `toward`
@msg no app to open files here ingen app til at åbne filer her
@msg no artboard ingen tegneflade
@msg no artboard {i} (0-based; the document has {_1}) ingen tegneflade {i} (0-baseret; dokumentet har {_1})
diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv
index 13790053e3..d643460089 100644
--- a/crates/ui-egui/src/i18n/de.tsv
+++ b/crates/ui-egui/src/i18n/de.tsv
@@ -115,6 +115,7 @@
Add to Selection Zur Auswahl hinzufügen
Add to Swatches Zu Farbfeldern hinzufügen
Add Used Colors Verwendete Farben hinzufügen
+ Add Selected Colors Ausgewählte Farben hinzufügen
Additional Plug-ins Folder Zusätzlicher Plug-in-Ordner
Plug-in Instruction Budget Anweisungsbudget für Plug-ins
Additional Fonts Folder Zusätzlicher Schriftenordner
@@ -214,6 +215,10 @@ font-technology Variable Variabel
Arc Bogen
Arc Lower… Bogen unten…
Arc Tool Bogen-Werkzeug
+ Three-Point Arc Tool Dreipunkt-Bogen-Werkzeug
+ Three-Point Arc Dreipunkt-Bogen
+ Arc too large Bogen zu groß
+ Third Point Sets Direction Dritter Punkt gibt die Richtung an
Arc Upper… Bogen oben…
Arch… Torbogen…
Arc… Bogen…
@@ -5263,6 +5268,10 @@ liquify-list-end {0}, {1} {0} und {1}
@msg a guide has no curvature circle eine Hilfslinie hat keinen Krümmungskreis
@msg the circle that matches the path there would reach past the canvas der Kreis, der dort zum Pfad passt, würde über die Arbeitsfläche hinausreichen
@msg no circle passes through these points: two are the same or all three lie on one line durch diese Punkte verläuft kein Kreis: zwei sind gleich oder alle drei liegen auf einer Linie
+@msg `at` must be "start" or "end" `at` muss „start“ oder „end“ sein
+@msg give exactly one of `through` and `toward` geben Sie genau eines von `through` und `toward` an
+@msg no arc fits these points: two are the same or all three lie on one line zu diesen Punkten passt kein Bogen: zwei sind gleich oder alle drei liegen auf einer Linie
+@msg give `at` only with `toward` geben Sie `at` nur zusammen mit `toward` an
@msg no app to open files here hier gibt es keine App zum Öffnen von Dateien
@msg no artboard keine Zeichenfläche
@msg no artboard {i} (0-based; the document has {_1}) keine Zeichenfläche {i} (Zählung ab 0; das Dokument hat {_1})
diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv
index 1e7a558f88..1d3640a6c9 100644
--- a/crates/ui-egui/src/i18n/el.tsv
+++ b/crates/ui-egui/src/i18n/el.tsv
@@ -120,6 +120,7 @@
Add to Selection Προσθήκη στην επιλογή
Add to Swatches Προσθήκη στα δείγματα χρωμάτων
Add Used Colors Προσθήκη των χρησιμοποιημένων χρωμάτων
+ Add Selected Colors Προσθήκη των επιλεγμένων χρωμάτων
Additional Plug-ins Folder Πρόσθετος φάκελος επεκτάσεων
Plug-in Instruction Budget Προϋπολογισμός εντολών επεκτάσεων
Additional Fonts Folder Πρόσθετος φάκελος γραμματοσειρών
@@ -216,6 +217,10 @@ font-technology Variable Μεταβλητές
Arc Τόξο
Arc Lower… Κάτω τόξο…
Arc Tool Τόξο (Arc Tool)
+ Three-Point Arc Tool Εργαλείο τόξου τριών σημείων
+ Three-Point Arc Τόξο τριών σημείων
+ Arc too large Το τόξο είναι πολύ μεγάλο
+ Third Point Sets Direction Το τρίτο σημείο ορίζει την κατεύθυνση
Arc Upper… Πάνω τόξο…
Arch… Αψίδα…
Arc… Τόξο…
@@ -5324,6 +5329,10 @@ digits Malayalam Μαλαγιάλαμ
@msg a guide has no curvature circle ένας οδηγός δεν έχει κύκλο καμπυλότητας
@msg the circle that matches the path there would reach past the canvas ο κύκλος που ταιριάζει με τη διαδρομή εκεί θα υπερέβαινε τον καμβά
@msg no circle passes through these points: two are the same or all three lie on one line κανένας κύκλος δεν περνά από αυτά τα σημεία: δύο είναι ίδια ή και τα τρία βρίσκονται σε μία ευθεία
+@msg `at` must be "start" or "end" το `at` πρέπει να είναι "start" ή "end"
+@msg give exactly one of `through` and `toward` δώστε ακριβώς ένα από τα `through` και `toward`
+@msg no arc fits these points: two are the same or all three lie on one line κανένα τόξο δεν ταιριάζει σε αυτά τα σημεία: δύο είναι ίδια ή και τα τρία βρίσκονται σε μία ευθεία
+@msg give `at` only with `toward` δώστε το `at` μόνο μαζί με το `toward`
@msg no app to open files here δεν υπάρχει εφαρμογή για άνοιγμα αρχείων εδώ
@msg no artboard δεν υπάρχει πίνακας σχεδίασης
@msg no artboard {i} (0-based; the document has {_1}) δεν υπάρχει πίνακας σχεδίασης {i} (αρίθμηση από 0· το έγγραφο περιέχει {_1})
diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv
index 17ef53b28c..bd141abc64 100644
--- a/crates/ui-egui/src/i18n/es.tsv
+++ b/crates/ui-egui/src/i18n/es.tsv
@@ -140,6 +140,7 @@
Add to Selection Agregar a la selección
Add to Swatches Agregar a muestras
Add Used Colors Agregar colores usados
+ Add Selected Colors Agregar colores seleccionados
Additional Plug-ins Folder Carpeta de plugins adicionales
Plug-in Instruction Budget Presupuesto de instrucciones de plugins
Additional Fonts Folder Carpeta de fuentes adicionales
@@ -237,6 +238,10 @@ font-technology Variable Variables
Arc Arco
Arc Lower… Arco inferior…
Arc Tool Herramienta Arco
+ Three-Point Arc Tool Herramienta Arco por tres puntos
+ Three-Point Arc Arco por tres puntos
+ Arc too large Arco demasiado grande
+ Third Point Sets Direction El tercer punto indica la dirección
Arc Upper… Arco superior…
Arch… Arcada…
Arc… Arco…
@@ -5375,6 +5380,10 @@ liquify-list-end {0}, {1} {0}, {1}
@msg a guide has no curvature circle una guía no tiene círculo de curvatura
@msg the circle that matches the path there would reach past the canvas el círculo que coincide con el trazado en ese punto excedería el lienzo
@msg no circle passes through these points: two are the same or all three lie on one line ningún círculo pasa por estos puntos: dos son iguales o los tres están en una misma línea
+@msg `at` must be "start" or "end" `at` debe ser "start" o "end"
+@msg give exactly one of `through` and `toward` indique exactamente uno de `through` y `toward`
+@msg no arc fits these points: two are the same or all three lie on one line ningún arco se ajusta a estos puntos: dos son iguales o los tres están en una misma línea
+@msg give `at` only with `toward` indique `at` solo junto con `toward`
@msg no app to open files here aquí no hay ninguna aplicación para abrir archivos
@msg no artboard no hay mesa de trabajo
@msg no artboard {i} (0-based; the document has {_1}) no existe la mesa de trabajo {i} (contando desde 0; el documento tiene {_1})
diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv
index 172648d442..64c71230a3 100644
--- a/crates/ui-egui/src/i18n/fi.tsv
+++ b/crates/ui-egui/src/i18n/fi.tsv
@@ -1502,6 +1502,10 @@ lighting Light Valo
Add Anchor Point Tool Lisää ankkuripiste -työkalu
Anchor Point Tool Ankkuripistetyökalu
Arc Tool Kaarityökalu
+ Three-Point Arc Tool Kolmen pisteen kaaren työkalu
+ Three-Point Arc Kolmen pisteen kaari
+ Arc too large Kaari on liian suuri
+ Third Point Sets Direction Kolmas piste määrää suunnan
Area Graph Tool Aluekaaviotyökalu
Area Type Tool Aluetekstityökalu
Artboard Tool Piirtoalustatyökalu
@@ -4366,6 +4370,7 @@ theme Appearance Ulkoasu
Add to Graphic Styles Lisää grafiikkatyyleihin
Graphic Style Library Grafiikkatyylikirjasto
Add Used Colors Lisää käytetyt värit
+ Add Selected Colors Lisää valitut värit
Delete Swatch Poista värimalli
Duplicate Swatch Monista värimalli
Merge Swatches Yhdistä värimallit
@@ -5608,6 +5613,10 @@ liquify-list-end {0}, {1} {0} ja {1}
@msg a guide has no curvature circle apuviivalla ei ole kaarevuusympyrää
@msg the circle that matches the path there would reach past the canvas ympyrä, joka vastaa polkua siinä kohdassa, ylittäisi kankaan
@msg no circle passes through these points: two are the same or all three lie on one line näiden pisteiden kautta ei kulje ympyrää: kaksi pisteistä on samoja tai kaikki kolme ovat samalla suoralla
+@msg `at` must be "start" or "end" `at` on oltava "start" tai "end"
+@msg give exactly one of `through` and `toward` anna täsmälleen yksi parametreista `through` ja `toward`
+@msg no arc fits these points: two are the same or all three lie on one line näihin pisteisiin ei sovi kaarta: kaksi pisteistä on samoja tai kaikki kolme ovat samalla suoralla
+@msg give `at` only with `toward` anna `at` vain yhdessä parametrin `toward` kanssa
@msg no app to open files here täällä ei ole sovellusta tiedostojen avaamiseen
@msg no artboard ei piirtoalustaa
@msg no artboard {i} (0-based; the document has {_1}) ei piirtoalustaa {i} (0-pohjainen; asiakirjassa on {_1})
diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv
index 32c32361f9..f737740f9d 100644
--- a/crates/ui-egui/src/i18n/fr.tsv
+++ b/crates/ui-egui/src/i18n/fr.tsv
@@ -141,6 +141,7 @@
Add to Selection Ajouter à la sélection
Add to Swatches Ajouter au nuancier
Add Used Colors Ajouter les couleurs utilisées
+ Add Selected Colors Ajouter les couleurs sélectionnées
Additional Plug-ins Folder Dossier de modules externes supplémentaires
Plug-in Instruction Budget Budget d’instructions des modules externes
Additional Fonts Folder Dossier de polices supplémentaires
@@ -238,6 +239,10 @@ font-technology Variable Variables
Arc Arc
Arc Lower… Arc inférieur…
Arc Tool Outil Arc
+ Three-Point Arc Tool Outil Arc par trois points
+ Three-Point Arc Arc par trois points
+ Arc too large Arc trop grand
+ Third Point Sets Direction Le troisième point indique la direction
Arc Upper… Arc supérieur…
Arch… Arche…
Arc… Arc…
@@ -5334,6 +5339,10 @@ liquify-list-end {0}, {1} {0} et {1}
@msg a guide has no curvature circle un repère n’a pas de cercle de courbure
@msg the circle that matches the path there would reach past the canvas le cercle qui correspond au tracé à cet endroit dépasserait la zone de travail
@msg no circle passes through these points: two are the same or all three lie on one line aucun cercle ne passe par ces points : deux sont identiques ou les trois sont alignés
+@msg `at` must be "start" or "end" `at` doit valoir "start" ou "end"
+@msg give exactly one of `through` and `toward` indiquez exactement un seul de `through` et `toward`
+@msg no arc fits these points: two are the same or all three lie on one line aucun arc ne correspond à ces points : deux sont identiques ou les trois sont alignés
+@msg give `at` only with `toward` indiquez `at` uniquement avec `toward`
@msg no app to open files here aucune application pour ouvrir des fichiers ici
@msg no artboard aucun plan de travail
@msg no artboard {i} (0-based; the document has {_1}) aucun plan de travail {i} (numérotation à partir de 0 ; le document en a {_1})
diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv
index fec432636b..fc03faa181 100644
--- a/crates/ui-egui/src/i18n/gu.tsv
+++ b/crates/ui-egui/src/i18n/gu.tsv
@@ -149,6 +149,7 @@
Add Selected Artwork as One Asset પસંદ કરેલી આર્ટવર્ક એક સંપત્તિ તરીકે ઉમેરો
Add Spine Point સ્પાઇન બિંદુ ઉમેરો
Add Used Colors વપરાયેલા રંગ ઉમેરો
+ Add Selected Colors પસંદ કરેલા રંગ ઉમેરો
Add as Effect ઇફેક્ટ તરીકે ઉમેરો
Add space to fit ફિટ કરવા જગ્યા ઉમેરો
Add to Brushes બ્રશમાં ઉમેરો
@@ -282,6 +283,10 @@
Arc Lower… નીચે આર્ક…
Arc Segment Tool Options આર્ક સેગમેન્ટ ટૂલ વિકલ્પો
Arc Tool આર્ક ટૂલ
+ Three-Point Arc Tool ત્રણ-પૉઇન્ટ આર્ક ટૂલ
+ Three-Point Arc ત્રણ-પૉઇન્ટ આર્ક
+ Arc too large આર્ક ખૂબ મોટો છે
+ Third Point Sets Direction ત્રીજો પૉઇન્ટ દિશા નક્કી કરે છે
Arc Upper… ઉપર આર્ક…
Arch… કમાન…
Arc… આર્ક…
@@ -5631,6 +5636,10 @@ swatch [Registration] [રજિસ્ટ્રેશન]
Standard Single-line Composer સ્ટાન્ડર્ડ સિંગલ-લાઇન કમ્પોઝર
Standard Every-line Composer સ્ટાન્ડર્ડ એવરી-લાઇન કમ્પોઝર
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer આમાંથી એક હોવું જોઈએ: "singleLine", "everyLine", "standardSingleLine" અથવા "standardEveryLine"
+@msg `at` must be "start" or "end" `at` "start" અથવા "end" હોવું જોઈએ
+@msg give exactly one of `through` and `toward` `through` અને `toward` માંથી બરાબર એક આપો
+@msg no arc fits these points: two are the same or all three lie on one line આ પૉઇન્ટ્સમાં કોઈ આર્ક બેસતો નથી: બે એકસરખા છે અથવા ત્રણેય એક જ રેખા પર છે
+@msg give `at` only with `toward` `at` ફક્ત `toward` સાથે જ આપો
Engraving કોતરણી
Fine Hatching ઝીણી રેખાઓ
Dense Hatching ગાઢ રેખાઓ
diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv
index 98902eea91..1ef34c8c23 100644
--- a/crates/ui-egui/src/i18n/hi.tsv
+++ b/crates/ui-egui/src/i18n/hi.tsv
@@ -255,6 +255,7 @@
Add to Symbols सिंबल्स में जोड़ें
Add to the Current Shortcuts वर्तमान शॉर्टकट में जोड़ें
Add Used Colors उपयोग किए रंग जोड़ें
+ Add Selected Colors सिलेक्टेड रंग जोड़ें
Additional Fonts Folder अतिरिक्त फ़ॉन्ट फ़ोल्डर
Additional Plug-ins Folder अतिरिक्त प्लग-इन फ़ोल्डर
Plug-in Instruction Budget प्लग-इन निर्देश बजट
@@ -397,6 +398,10 @@ antiAlias Sharp शार्प
Arc Lower… निचला आर्क…
Arc Segment Tool Options आर्क सेगमेंट टूल ऑप्शन्स
Arc Tool आर्क टूल
+ Three-Point Arc Tool थ्री-पॉइंट आर्क टूल
+ Three-Point Arc थ्री-पॉइंट आर्क
+ Arc too large आर्क बहुत बड़ा है
+ Third Point Sets Direction तीसरा पॉइंट दिशा तय करता है
Arc Upper… ऊपरी आर्क…
Arc… आर्क…
Arch… मेहराब…
@@ -8303,6 +8308,10 @@ liquify-list-end {0}, {1} {0} और {1}
@msg a guide has no curvature circle गाइड का कोई वक्रता वृत्त नहीं होता
@msg the circle that matches the path there would reach past the canvas वहाँ पाथ से मेल खाने वाला वृत्त कैनवास से बाहर चला जाएगा
@msg no circle passes through these points: two are the same or all three lie on one line इन पॉइंट्स से होकर कोई वृत्त नहीं गुज़रता: दो एक जैसे हैं या तीनों एक ही रेखा पर हैं
+@msg `at` must be "start" or "end" `at` को "start" या "end" होना चाहिए।
+@msg give exactly one of `through` and `toward` `through` और `toward` में से ठीक एक दें
+@msg no arc fits these points: two are the same or all three lie on one line इन पॉइंट्स पर कोई आर्क फ़िट नहीं होता: दो एक जैसे हैं या तीनों एक ही रेखा पर हैं
+@msg give `at` only with `toward` `at` केवल `toward` के साथ दें
@msg no app to open files here यहां फ़ाइलों को ओपन करने के लिए कोई ऐप नहीं है
@msg no appearance item {index} कोई उपस्थिति आइटम {index}
@msg no artboard कोई आर्टबोर्ड नहीं
diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv
index 2b3e7be907..f106f067c3 100644
--- a/crates/ui-egui/src/i18n/hu.tsv
+++ b/crates/ui-egui/src/i18n/hu.tsv
@@ -209,6 +209,7 @@
Add to Selection Hozzáadás a kijelöléshez
Add to Swatches Hozzáadás a színmintákhoz
Add Used Colors Használt színek hozzáadása
+ Add Selected Colors Kijelölt színek hozzáadása
Additional Fonts Folder További betűtípusok mappája
Additional Plug-ins Folder További bővítmények mappája
Plug-in Instruction Budget Bővítmények utasításkerete
@@ -321,6 +322,10 @@ font-technology Variable Változó
Arc Ív
Arc Lower… Alsó ív…
Arc Tool Ív
+ Three-Point Arc Tool Hárompontos ív eszköz
+ Three-Point Arc Hárompontos ív
+ Arc too large Az ív túl nagy
+ Third Point Sets Direction A harmadik pont adja meg az irányt
Arc Upper… Felső ív…
Arch… Boltív…
Arc… Ív…
@@ -6061,6 +6066,10 @@ liquify-list-end {0}, {1} {0} és {1}
@msg a guide has no curvature circle a segédvonalnak nincs görbületi köre
@msg the circle that matches the path there would reach past the canvas az útvonalhoz ott illeszkedő kör túlnyúlna a vásznon
@msg no circle passes through these points: two are the same or all three lie on one line ezeken a pontokon nem halad át kör: kettő egybeesik, vagy mindhárom egy egyenesen van
+@msg `at` must be "start" or "end" `at`: "start" vagy "end" kell
+@msg give exactly one of `through` and `toward` pontosan egyet adjon meg a `through` és a `toward` közül
+@msg no arc fits these points: two are the same or all three lie on one line ezekre a pontokra nem illeszkedik ív: kettő egybeesik, vagy mindhárom egy egyenesen van
+@msg give `at` only with `toward` az `at` csak a `toward` mellett adható meg
@msg no app to open files here itt nincs fájlmegnyitó alkalmazás
@msg no artboard nincs rajztábla
@msg no artboard {i} (0-based; the document has {_1}) nincs ilyen sorszámú rajztábla: {i} (0-tól számozva; a dokumentumban ennyi van: {_1})
diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv
index d003b87704..a7c37fd42a 100644
--- a/crates/ui-egui/src/i18n/id.tsv
+++ b/crates/ui-egui/src/i18n/id.tsv
@@ -2061,6 +2061,10 @@ lighting Light Cahaya
Add Anchor Point Tool Alat tambah titik jangkar
Anchor Point Tool Alat titik jangkar
Arc Tool Alat busur
+ Three-Point Arc Tool Alat busur tiga titik
+ Three-Point Arc Busur tiga titik
+ Arc too large Busur terlalu besar
+ Third Point Sets Direction Titik ketiga menentukan arah
Area Graph Tool Alat grafik area
Area Type Tool Alat teks area
Artboard Tool Alat artboard
@@ -4769,6 +4773,7 @@ theme Appearance Tampilan
Add to Graphic Styles Tambahkan ke gaya grafis
Graphic Style Library Pustaka gaya grafis
Add Used Colors Tambahkan warna yang digunakan
+ Add Selected Colors Tambahkan warna terpilih
Delete Swatch Hapus sampel
Duplicate Swatch Duplikatkan sampel
Merge Swatches Gabungkan sampel
@@ -8582,6 +8587,10 @@ breakText Glyphs Glif
@msg A joint does not close by {gap} pt. Sebuah sambungan tidak menutup sejauh {gap} pt.
@msg Two panels pass through each other. Dua panel saling menembus.
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer harus "singleLine", "everyLine", "standardSingleLine", atau "standardEveryLine"
+@msg `at` must be "start" or "end" `at` harus "start" atau "end"
+@msg give exactly one of `through` and `toward` berikan tepat satu dari `through` dan `toward`
+@msg no arc fits these points: two are the same or all three lie on one line tidak ada busur yang cocok dengan titik-titik ini: dua titik sama atau ketiganya segaris
+@msg give `at` only with `toward` berikan `at` hanya bersama `toward`
Engraving Ukiran
Fine Hatching Arsiran halus
Dense Hatching Arsiran rapat
diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv
index 56c398470a..7431c36bef 100644
--- a/crates/ui-egui/src/i18n/it.tsv
+++ b/crates/ui-egui/src/i18n/it.tsv
@@ -140,6 +140,7 @@
Add to Selection Aggiungi alla selezione
Add to Swatches Aggiungi ai campioni
Add Used Colors Aggiungi colori usati
+ Add Selected Colors Aggiungi colori selezionati
Additional Plug-ins Folder Cartella plug-in aggiuntivi
Plug-in Instruction Budget Budget di istruzioni dei plug-in
Additional Fonts Folder Cartella font aggiuntivi
@@ -239,6 +240,10 @@ font-technology Variable Variabili
Arc Arco
Arc Lower… Arco inferiore…
Arc Tool Strumento Arco
+ Three-Point Arc Tool Strumento Arco per tre punti
+ Three-Point Arc Arco per tre punti
+ Arc too large Arco troppo grande
+ Third Point Sets Direction Il terzo punto indica la direzione
Arc Upper… Arco superiore…
Arch… Arcata…
Arc… Arco…
@@ -5401,6 +5406,10 @@ liquify-list-end {0}, {1} {0} e {1}
@msg a guide has no curvature circle una guida non ha un cerchio di curvatura
@msg the circle that matches the path there would reach past the canvas il cerchio che corrisponde al tracciato in quel punto supererebbe l'area di lavoro
@msg no circle passes through these points: two are the same or all three lie on one line nessun cerchio passa per questi punti: due coincidono oppure tutti e tre sono allineati
+@msg `at` must be "start" or "end" `at` deve essere "start" o "end"
+@msg give exactly one of `through` and `toward` indicare esattamente uno tra `through` e `toward`
+@msg no arc fits these points: two are the same or all three lie on one line nessun arco si adatta a questi punti: due coincidono oppure tutti e tre sono allineati
+@msg give `at` only with `toward` indicare `at` solo insieme a `toward`
@msg no app to open files here nessuna app per aprire file qui
@msg no artboard nessuna tavola da disegno
@msg no artboard {i} (0-based; the document has {_1}) nessuna tavola da disegno {i} (a partire da 0; il documento ne ha {_1})
diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv
index c84a9c0ade..da6944dd84 100644
--- a/crates/ui-egui/src/i18n/ja.tsv
+++ b/crates/ui-egui/src/i18n/ja.tsv
@@ -1155,6 +1155,7 @@ digits Malayalam マラヤーラム数字
Add Selected Artwork as One Asset 選択したアートワークを 1 つのアセットとして追加
Add Spine Point スパインポイントを追加
Add Used Colors 使用中のカラーを追加
+ Add Selected Colors 選択したカラーを追加
Add to Graphic Styles グラフィックスタイルに追加
Add to Profiles プロファイルに追加
Add to Profiles… プロファイルに追加…
@@ -1235,6 +1236,10 @@ antiAlias Sharp シャープ
@plural Apply to All ({n} more missing)|Apply to All ({n} more missing) すべてに適用 (ほかに {n} 個が見つかりません)
Arc 円弧
Arc Tool 円弧ツール
+ Three-Point Arc Tool 3 点円弧ツール
+ Three-Point Arc 3 点円弧
+ Arc too large 円弧が大きすぎます
+ Third Point Sets Direction 3 点目で方向を指定
Area / Path Type エリア内文字/パス上文字
Area Graph Tool 面グラフツール
Area Type Tool エリア内文字ツール
@@ -5166,6 +5171,10 @@ variable-list-end {0}, {1} {0}、{1}
@msg a guide has no curvature circle ガイドには曲率円がありません
@msg the circle that matches the path there would reach past the canvas その位置でパスに合う円はキャンバスからはみ出します
@msg no circle passes through these points: two are the same or all three lie on one line これらの点を通る円はありません: 2 つの点が同じか、3 点すべてが一直線上にあります
+@msg `at` must be "start" or "end" `at` には "start" または "end" を指定してください
+@msg give exactly one of `through` and `toward` `through` と `toward` のどちらか一方だけを指定してください
+@msg no arc fits these points: two are the same or all three lie on one line これらの点に合う円弧はありません: 2 つの点が同じか、3 点すべてが一直線上にあります
+@msg give `at` only with `toward` `at` は `toward` と一緒にだけ指定してください
@msg select at least two objects オブジェクトを 2 つ以上選択してください
@msg exit isolation mode first 先に分離モードを終了してください
@msg no saved presets 保存したプリセットはありません
diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv
index 805a62df06..78cd611e5a 100644
--- a/crates/ui-egui/src/i18n/ka.tsv
+++ b/crates/ui-egui/src/i18n/ka.tsv
@@ -3585,6 +3585,10 @@ lighting Light სინათლე
Add Anchor Point Tool საყრდენი წერტილის დამატების ხელსაწყო
Anchor Point Tool საყრდენი წერტილის ხელსაწყო
Arc Tool რკალის ხელსაწყო
+ Three-Point Arc Tool სამწერტილიანი რკალის ხელსაწყო
+ Three-Point Arc სამწერტილიანი რკალი
+ Arc too large რკალი ზედმეტად დიდია
+ Third Point Sets Direction მესამე წერტილი მიმართულებას განსაზღვრავს
Area Graph Tool ფართობითი დიაგრამის ხელსაწყო
Area Type Tool არის ტექსტის ხელსაწყო
Artboard Tool სამუშაო დაფის ხელსაწყო
@@ -6182,6 +6186,7 @@ theme Appearance იერსახე
Add to Graphic Styles გრაფიკულ სტილებში დამატება
Graphic Style Library გრაფიკული სტილების ბიბლიოთეკა
Add Used Colors გამოყენებული ფერების დამატება
+ Add Selected Colors მონიშნული ფერების დამატება
Delete Swatch ფერის ნიმუშის წაშლა
Duplicate Swatch ფერის ნიმუშის დუბლირება
Merge Swatches ფერის ნიმუშების შერწყმა
@@ -7142,6 +7147,10 @@ font-technology Variable ცვლადი
@msg a guide has no curvature circle დამხმარე ხაზს სიმრუდის წრე არ აქვს
@msg the circle that matches the path there would reach past the canvas წრეწირი, რომელიც იქ ტრაექტორიას შეესაბამება, ტილოს გასცდებოდა
@msg no circle passes through these points: two are the same or all three lie on one line ამ წერტილებზე წრეწირი არ გადის: ორი ერთნაირია ან სამივე ერთ წრფეზე მდებარეობს
+@msg `at` must be "start" or "end" `at` უნდა იყოს "start" ან "end"
+@msg give exactly one of `through` and `toward` მიუთითეთ ზუსტად ერთი: `through` ან `toward`
+@msg no arc fits these points: two are the same or all three lie on one line ამ წერტილებს რკალი არ ერგება: ორი ერთნაირია ან სამივე ერთ წრფეზე მდებარეობს
+@msg give `at` only with `toward` `at` მიუთითეთ მხოლოდ `toward`-თან ერთად
@msg no app to open files here აქ ფაილების გასახსნელი აპი არ არის
@msg no artboard სამუშაო დაფა არ არის
@msg no artboard {i} (0-based; the document has {_1}) სამუშაო დაფა {i} არ არსებობს (0-დან ითვლება; დოკუმენტს აქვს {_1})
diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv
index f276d09fab..3c468a4aec 100644
--- a/crates/ui-egui/src/i18n/ko.tsv
+++ b/crates/ui-egui/src/i18n/ko.tsv
@@ -1145,6 +1145,7 @@ digits Malayalam 말라얄람어
Add Selected Artwork as One Asset 선택한 아트워크를 하나의 에셋으로 추가
Add Spine Point 스파인 포인트 추가
Add Used Colors 사용한 색상 추가
+ Add Selected Colors 선택한 색상 추가
Add to Graphic Styles 그래픽 스타일에 추가
Add to Profiles 프로필에 추가
Add to Profiles… 프로필에 추가…
@@ -1225,6 +1226,10 @@ antiAlias Sharp 날카롭게
@plural Apply to All ({n} more missing)|Apply to All ({n} more missing) 모두에 적용(누락 {n}개 더 있음)
Arc 호
Arc Tool 호 도구
+ Three-Point Arc Tool 3점 호 도구
+ Three-Point Arc 3점 호
+ Arc too large 호가 너무 큽니다
+ Third Point Sets Direction 세 번째 점으로 방향 지정
Area / Path Type 영역/패스 문자
Area Graph Tool 영역 그래프 도구
Area Type Tool 영역 문자 도구
@@ -5095,6 +5100,10 @@ variable-list-end {0}, {1} {0} 및 {1}
@msg a guide has no curvature circle 안내선에는 곡률원이 없습니다
@msg the circle that matches the path there would reach past the canvas 그 위치에서 패스에 맞는 원이 캔버스를 벗어납니다
@msg no circle passes through these points: two are the same or all three lie on one line 이 점들을 지나는 원이 없습니다: 두 점이 같거나 세 점이 모두 한 직선 위에 있습니다
+@msg `at` must be "start" or "end" `at`은(는) "start" 또는 "end"여야 합니다
+@msg give exactly one of `through` and `toward` `through`와 `toward` 중 정확히 하나만 지정하세요
+@msg no arc fits these points: two are the same or all three lie on one line 이 점들에 맞는 호가 없습니다: 두 점이 같거나 세 점이 모두 한 직선 위에 있습니다
+@msg give `at` only with `toward` `at`은(는) `toward`와 함께만 지정하세요
@msg select at least two objects 개체를 두 개 이상 선택하세요
@msg exit isolation mode first 먼저 격리 모드를 종료하세요
@msg no saved presets 저장된 프리셋이 없습니다
diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv
index 2abc926b19..234f902d28 100644
--- a/crates/ui-egui/src/i18n/nl.tsv
+++ b/crates/ui-egui/src/i18n/nl.tsv
@@ -2053,6 +2053,10 @@ lighting Light Licht
Add Anchor Point Tool Ankerpunt toevoegen
Anchor Point Tool Ankerpunt-gereedschap
Arc Tool Boog-gereedschap
+ Three-Point Arc Tool Driepuntsboog-gereedschap
+ Three-Point Arc Driepuntsboog
+ Arc too large Boog te groot
+ Third Point Sets Direction Derde punt geeft de richting aan
Area Graph Tool Vlakdiagram-gereedschap
Area Type Tool Vlaktype-gereedschap
Artboard Tool Tekengebied-gereedschap
@@ -4774,6 +4778,7 @@ theme Appearance Vormgeving
Add to Graphic Styles Aan grafische stijlen toevoegen
Graphic Style Library Bibliotheek met grafische stijlen
Add Used Colors Gebruikte kleuren toevoegen
+ Add Selected Colors Geselecteerde kleuren toevoegen
Delete Swatch Kleurstaal verwijderen
Duplicate Swatch Kleurstaal dupliceren
Merge Swatches Kleurstalen samenvoegen
@@ -5759,6 +5764,10 @@ imageTrace Outline Contour
@msg a guide has no curvature circle een hulplijn heeft geen krommingscirkel
@msg the circle that matches the path there would reach past the canvas de cirkel die daar bij het pad past, zou voorbij het canvas reiken
@msg no circle passes through these points: two are the same or all three lie on one line er gaat geen cirkel door deze punten: twee zijn gelijk of alle drie liggen op één lijn
+@msg `at` must be "start" or "end" `at` moet "start" of "end" zijn
+@msg give exactly one of `through` and `toward` geef precies één van `through` en `toward`
+@msg no arc fits these points: two are the same or all three lie on one line er past geen boog bij deze punten: twee zijn gelijk of alle drie liggen op één lijn
+@msg give `at` only with `toward` geef `at` alleen samen met `toward`
@msg no app to open files here hier is geen app om bestanden mee te openen
@msg no artboard geen tekengebied
@msg no artboard {i} (0-based; the document has {_1}) geen tekengebied {i} (vanaf 0; het document heeft er {_1})
diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv
index 3d59efbb75..806c1dd307 100644
--- a/crates/ui-egui/src/i18n/pl.tsv
+++ b/crates/ui-egui/src/i18n/pl.tsv
@@ -1457,6 +1457,10 @@ lighting Light Światło
Add Anchor Point Tool Narzędzie Dodaj punkt kontrolny
Anchor Point Tool Narzędzie Punkt kontrolny
Arc Tool Narzędzie Łuk
+ Three-Point Arc Tool Narzędzie Łuk przez trzy punkty
+ Three-Point Arc Łuk przez trzy punkty
+ Arc too large Łuk jest za duży
+ Third Point Sets Direction Trzeci punkt wyznacza kierunek
Area Graph Tool Narzędzie Wykres warstwowy
Area Type Tool Narzędzie Tekst akapitowy
Artboard Tool Narzędzie Obszar kompozycji
@@ -4310,6 +4314,7 @@ theme Appearance Wygląd
Add to Graphic Styles Dodaj do stylów graficznych
Graphic Style Library Biblioteka stylów graficznych
Add Used Colors Dodaj użyte kolory
+ Add Selected Colors Dodaj zaznaczone kolory
Delete Swatch Usuń próbkę
Duplicate Swatch Powiel próbkę
Merge Swatches Scal próbki
@@ -5504,6 +5509,10 @@ liquify-list-end {0}, {1} {0} i {1}
@msg a guide has no curvature circle linia pomocnicza nie ma okręgu krzywizny
@msg the circle that matches the path there would reach past the canvas okrąg pasujący w tym miejscu do ścieżki wykroczyłby poza płótno
@msg no circle passes through these points: two are the same or all three lie on one line przez te punkty nie przechodzi żaden okrąg: dwa są takie same albo wszystkie trzy leżą na jednej prostej
+@msg `at` must be "start" or "end" `at` musi mieć wartość "start" lub "end"
+@msg give exactly one of `through` and `toward` podaj dokładnie jeden z parametrów `through` i `toward`
+@msg no arc fits these points: two are the same or all three lie on one line żaden łuk nie pasuje do tych punktów: dwa są takie same albo wszystkie trzy leżą na jednej prostej
+@msg give `at` only with `toward` podaj `at` tylko razem z `toward`
@msg no app to open files here brak aplikacji do otwierania plików
@msg no artboard brak obszaru kompozycji
@msg no artboard {i} (0-based; the document has {_1}) brak obszaru kompozycji {i} (numeracja od 0; dokument ma {_1})
diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv
index 57f40336fb..c7751c688e 100644
--- a/crates/ui-egui/src/i18n/pt-br.tsv
+++ b/crates/ui-egui/src/i18n/pt-br.tsv
@@ -141,6 +141,7 @@
Add Selected Artwork as One Asset Adicionar Arte Selecionada como Um Ativo
Add Spine Point Adicionar Ponto de Coluna
Add Used Colors Adicionar Cores Usadas
+ Add Selected Colors Adicionar Cores Selecionadas
Add to Graphic Styles Adicionar aos Estilos Gráficos
Add to Profiles Adicionar aos Perfis
Add to Profiles… Adicionar aos Perfis…
@@ -232,6 +233,10 @@ antiAlias Sharp Nítido
Arc Arco
Arc Lower… Arco Inferior…
Arc Tool Ferramenta Arco
+ Three-Point Arc Tool Ferramenta Arco por três pontos
+ Three-Point Arc Arco por três pontos
+ Arc too large Arco grande demais
+ Third Point Sets Direction O terceiro ponto indica a direção
Arc Upper… Arco Superior…
Arch… Abóbada…
Arc… Arco…
@@ -4649,6 +4654,10 @@ axis Both Ambos
@msg a guide has no curvature circle uma guia não tem círculo de curvatura
@msg the circle that matches the path there would reach past the canvas o círculo que corresponde ao caminho nesse ponto ultrapassaria a tela
@msg no circle passes through these points: two are the same or all three lie on one line nenhum círculo passa por esses pontos: dois são iguais ou os três estão na mesma reta
+@msg `at` must be "start" or "end" `at` deve ser "start" ou "end"
+@msg give exactly one of `through` and `toward` informe exatamente um entre `through` e `toward`
+@msg no arc fits these points: two are the same or all three lie on one line nenhum arco se ajusta a esses pontos: dois são iguais ou os três estão na mesma reta
+@msg give `at` only with `toward` informe `at` somente com `toward`
@msg no app to open files here nenhum aplicativo para abrir arquivos aqui
@msg no artboard nenhuma prancheta
@msg no artboard {i} (0-based; the document has {_1}) nenhuma prancheta {i} (base 0; o documento tem {_1})
diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv
index 3602715813..cd372ca861 100644
--- a/crates/ui-egui/src/i18n/ru.tsv
+++ b/crates/ui-egui/src/i18n/ru.tsv
@@ -138,6 +138,7 @@
Add to Selection Добавить к выделению
Add to Swatches Добавить в образцы
Add Used Colors Добавить использованные цвета
+ Add Selected Colors Добавить выбранные цвета
Additional Plug-ins Folder Папка дополнительных модулей
Plug-in Instruction Budget Бюджет инструкций модулей
Additional Fonts Folder Папка дополнительных шрифтов
@@ -235,6 +236,10 @@ font-technology Variable Вариативные
Arc Дуга
Arc Lower… Дуга снизу…
Arc Tool Инструмент «Дуга»
+ Three-Point Arc Tool Инструмент «Дуга по трём точкам»
+ Three-Point Arc Дуга по трём точкам
+ Arc too large Дуга слишком велика
+ Third Point Sets Direction Третья точка задаёт направление
Arc Upper… Дуга сверху…
Arch… Арка…
Arc… Дуга…
@@ -5397,6 +5402,10 @@ liquify-list-end {0}, {1} {0} и {1}
@msg a guide has no curvature circle у направляющей нет круга кривизны
@msg the circle that matches the path there would reach past the canvas окружность, соответствующая контуру в этом месте, вышла бы за пределы холста
@msg no circle passes through these points: two are the same or all three lie on one line через эти точки не проходит ни одна окружность: две точки совпадают или все три лежат на одной прямой
+@msg `at` must be "start" or "end" `at` должно быть "start" или "end"
+@msg give exactly one of `through` and `toward` укажите ровно один из параметров `through` и `toward`
+@msg no arc fits these points: two are the same or all three lie on one line ни одна дуга не подходит к этим точкам: две точки совпадают или все три лежат на одной прямой
+@msg give `at` only with `toward` указывайте `at` только вместе с `toward`
@msg no app to open files here здесь нет приложения для открытия файлов
@msg no artboard нет монтажной области
@msg no artboard {i} (0-based; the document has {_1}) нет монтажной области {i} (счёт с 0; в документе {_1})
diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv
index 86285b8bd1..57182f4e11 100644
--- a/crates/ui-egui/src/i18n/sv.tsv
+++ b/crates/ui-egui/src/i18n/sv.tsv
@@ -128,6 +128,7 @@
Add to Selection Lägg till i markering
Add to Swatches Lägg till i färgrutor
Add Used Colors Lägg till använda färger
+ Add Selected Colors Lägg till markerade färger
Additional Plug-ins Folder Mapp för ytterligare plugins
Plug-in Instruction Budget Instruktionsbudget för plugins
Additional Fonts Folder Mapp för ytterligare typsnitt
@@ -226,6 +227,10 @@ font-technology Variable Variabla
Arc Båge
Arc Lower… Nedre båge…
Arc Tool Bågverktyg
+ Three-Point Arc Tool Verktyg för trepunktsbåge
+ Three-Point Arc Trepunktsbåge
+ Arc too large Bågen är för stor
+ Third Point Sets Direction Tredje punkten anger riktningen
Arc Upper… Övre båge…
Arch… Valv…
Arc… Båge…
@@ -5262,6 +5267,10 @@ liquify-list-end {0}, {1} {0} och {1}
@msg a guide has no curvature circle en stödlinje har ingen krökningscirkel
@msg the circle that matches the path there would reach past the canvas cirkeln som matchar banan där skulle nå utanför arbetsytan
@msg no circle passes through these points: two are the same or all three lie on one line ingen cirkel går genom de här punkterna: två är samma punkt eller så ligger alla tre på en linje
+@msg `at` must be "start" or "end" `at` måste vara "start" eller "end"
+@msg give exactly one of `through` and `toward` ange exakt en av `through` och `toward`
+@msg no arc fits these points: two are the same or all three lie on one line ingen båge passar de här punkterna: två är samma punkt eller så ligger alla tre på en linje
+@msg give `at` only with `toward` ange `at` endast tillsammans med `toward`
@msg no app to open files here det finns ingen app för att öppna filer här
@msg no artboard ingen rityta
@msg no artboard {i} (0-based; the document has {_1}) ingen rityta {i} (räknat från 0; dokumentet har {_1})
diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv
index 5d03123f6d..217e9a6324 100644
--- a/crates/ui-egui/src/i18n/tr.tsv
+++ b/crates/ui-egui/src/i18n/tr.tsv
@@ -125,6 +125,7 @@
Add to Selection Seçime Ekle
Add to Swatches Renk Örneklerine Ekle
Add Used Colors Kullanılan Renkleri Ekle
+ Add Selected Colors Seçilen Renkleri Ekle
Additional Plug-ins Folder Ek Eklentiler Klasörü
Plug-in Instruction Budget Eklenti Talimat Bütçesi
Additional Fonts Folder Ek Yazı Tipleri Klasörü
@@ -222,6 +223,10 @@ font-technology Variable Değişken
Arc Yay
Arc Lower… Ark Alt…
Arc Tool Yay Aracı
+ Three-Point Arc Tool Üç Noktalı Yay Aracı
+ Three-Point Arc Üç Noktalı Yay
+ Arc too large Yay çok büyük
+ Third Point Sets Direction Üçüncü Nokta Yönü Belirler
Arc Upper… Ark Üst…
Arch… Kemer…
Arc… Yay…
@@ -5087,6 +5092,10 @@ liquify-list-end {0}, {1} {0} ve {1}
@msg a guide has no curvature circle bir kılavuzun eğrilik çemberi yoktur
@msg the circle that matches the path there would reach past the canvas yolla orada eşleşen çember tuvalin dışına taşardı
@msg no circle passes through these points: two are the same or all three lie on one line bu noktalardan geçen bir çember yok: ikisi aynı ya da üçü de aynı doğru üzerinde
+@msg `at` must be "start" or "end" `at` "start" veya "end" olmalıdır
+@msg give exactly one of `through` and `toward` `through` ve `toward` değerlerinden tam olarak birini verin
+@msg no arc fits these points: two are the same or all three lie on one line bu noktalara uyan bir yay yok: ikisi aynı ya da üçü de aynı doğru üzerinde
+@msg give `at` only with `toward` `at` değerini yalnızca `toward` ile birlikte verin
@msg no app to open files here burada dosyaları açacak uygulama yok
@msg no artboard çalışma yüzeyi yok
@msg no artboard {i} (0-based; the document has {_1}) çalışma yüzeyi yok {i} (0 tabanlı; belgede {_1} var)
diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv
index fae21685e4..0a7275c159 100644
--- a/crates/ui-egui/src/i18n/uk.tsv
+++ b/crates/ui-egui/src/i18n/uk.tsv
@@ -134,6 +134,7 @@
Add to Selection Додати до виділення
Add to Swatches Додати до зразків
Add Used Colors Додати використані кольори
+ Add Selected Colors Додати вибрані кольори
Additional Plug-ins Folder Папка додаткових модулів
Plug-in Instruction Budget Бюджет інструкцій модулів
Additional Fonts Folder Папка додаткових шрифтів
@@ -233,6 +234,10 @@ font-technology Variable Варіативні
Arc Дуга
Arc Lower… Дуга знизу…
Arc Tool Інструмент «Дуга»
+ Three-Point Arc Tool Інструмент «Дуга за трьома точками»
+ Three-Point Arc Дуга за трьома точками
+ Arc too large Дуга завелика
+ Third Point Sets Direction Третя точка задає напрямок
Arc Upper… Дуга зверху…
Arch… Арка…
Arc… Дуга…
@@ -5385,6 +5390,10 @@ liquify-list-end {0}, {1} {0} і {1}
@msg a guide has no curvature circle напрямна не має кола кривини
@msg the circle that matches the path there would reach past the canvas коло, що відповідає контуру в цьому місці, вийшло б за межі полотна
@msg no circle passes through these points: two are the same or all three lie on one line через ці точки не проходить жодне коло: дві точки збігаються або всі три лежать на одній прямій
+@msg `at` must be "start" or "end" `at` має бути "start" або "end"
+@msg give exactly one of `through` and `toward` вкажіть рівно один із параметрів `through` і `toward`
+@msg no arc fits these points: two are the same or all three lie on one line жодна дуга не підходить до цих точок: дві точки збігаються або всі три лежать на одній прямій
+@msg give `at` only with `toward` вказуйте `at` лише разом із `toward`
@msg no app to open files here тут немає програми для відкриття файлів
@msg no artboard немає монтажної області
@msg no artboard {i} (0-based; the document has {_1}) немає монтажної області {i} (рахунок з 0; у документі {_1})
diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv
index 6b5a790198..1cc1c22f5e 100644
--- a/crates/ui-egui/src/i18n/vi.tsv
+++ b/crates/ui-egui/src/i18n/vi.tsv
@@ -155,6 +155,7 @@
Add to Selection Thêm vào vùng chọn
Add to Swatches Thêm vào mẫu màu
Add Used Colors Thêm các màu đã dùng
+ Add Selected Colors Thêm các màu đã chọn
Additional Fonts Folder Thư mục phông bổ sung
Additional Plug-ins Folder Thư mục plug-in bổ sung
Plug-in Instruction Budget Ngân sách lệnh của plug-in
@@ -258,6 +259,10 @@ font-technology Variable Biến thiên
Arc Cung
Arc Lower… Cung dưới…
Arc Tool Công cụ Cung
+ Three-Point Arc Tool Công cụ Cung ba điểm
+ Three-Point Arc Cung ba điểm
+ Arc too large Cung quá lớn
+ Third Point Sets Direction Điểm thứ ba chỉ hướng
Arc Upper… Cung trên…
Arch… Vòm…
Arc… Cung…
@@ -5754,6 +5759,10 @@ liquify-list-end {0}, {1} {0} và {1}
@msg a guide has no curvature circle đường căn không có đường tròn độ cong
@msg the circle that matches the path there would reach past the canvas đường tròn khớp với đường dẫn tại đó sẽ vượt quá giới hạn vùng vẽ
@msg no circle passes through these points: two are the same or all three lie on one line không có đường tròn nào đi qua các điểm này: hai điểm trùng nhau hoặc cả ba điểm thẳng hàng
+@msg `at` must be "start" or "end" `at` phải là "start" hoặc "end"
+@msg give exactly one of `through` and `toward` hãy cho đúng một trong hai `through` và `toward`
+@msg no arc fits these points: two are the same or all three lie on one line không có cung nào khớp với các điểm này: hai điểm trùng nhau hoặc cả ba điểm thẳng hàng
+@msg give `at` only with `toward` chỉ cho `at` cùng với `toward`
@msg no app to open files here không có ứng dụng để mở tệp ở đây
@msg no artboard không có bảng vẽ
@msg no artboard {i} (0-based; the document has {_1}) không có bảng vẽ {i} (bắt đầu từ 0; tài liệu có {_1})
diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv
index d68c8c11d0..4d55bfa285 100644
--- a/crates/ui-egui/src/i18n/zh-hans.tsv
+++ b/crates/ui-egui/src/i18n/zh-hans.tsv
@@ -89,6 +89,7 @@
Add to Selection 添加到选区
Add to Swatches 添加到色板
Add Used Colors 添加已用颜色
+ Add Selected Colors 添加所选颜色
Additional Plug-ins Folder 附加增效工具文件夹
Plug-in Instruction Budget 增效工具指令预算
Additional Fonts Folder 附加字体文件夹
@@ -183,6 +184,10 @@ antiAlias Sharp 锐利
Arc 弧形
Arc Lower… 下弧形…
Arc Tool 弧形工具
+ Three-Point Arc Tool 三点弧形工具
+ Three-Point Arc 三点弧形
+ Arc too large 弧形过大
+ Third Point Sets Direction 第三点指示方向
Arc Upper… 上弧形…
Arch… 拱形…
Arc… 弧形…
@@ -4852,6 +4857,10 @@ imageTrace Outline 轮廓
@msg a guide has no curvature circle 参考线没有曲率圆
@msg the circle that matches the path there would reach past the canvas 在该处与路径曲率相符的圆会超出画布
@msg no circle passes through these points: two are the same or all three lie on one line 没有圆经过这些点:有两点相同,或三点共线
+@msg `at` must be "start" or "end" `at` 必须是 "start" 或 "end"
+@msg give exactly one of `through` and `toward` `through` 和 `toward` 必须且只能指定一个
+@msg no arc fits these points: two are the same or all three lie on one line 没有弧形符合这些点:有两点相同,或三点共线
+@msg give `at` only with `toward` `at` 只能与 `toward` 一起指定
@msg select at least two objects 请至少选择两个对象
@msg exit isolation mode first 请先退出隔离模式
@msg no saved presets 没有已保存的预设
diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv
index a77574f1a0..58dcb82a43 100644
--- a/crates/ui-egui/src/i18n/zh-hant.tsv
+++ b/crates/ui-egui/src/i18n/zh-hant.tsv
@@ -98,6 +98,7 @@
Add to Selection 加入選取範圍
Add to Swatches 新增至色票
Add Used Colors 新增使用中的顏色
+ Add Selected Colors 新增所選顏色
Additional Plug-ins Folder 額外的增效模組資料夾
Plug-in Instruction Budget 增效模組指令預算
Additional Fonts Folder 額外的字體資料夾
@@ -197,6 +198,10 @@ font-technology Variable 可變
Arc 弧形
Arc Lower… 下弧形…
Arc Tool 弧形工具
+ Three-Point Arc Tool 三點弧形工具
+ Three-Point Arc 三點弧形
+ Arc too large 弧形過大
+ Third Point Sets Direction 第三點指示方向
Arc Upper… 上弧形…
Arch… 拱形…
Arc… 弧形…
@@ -2221,6 +2226,10 @@ file-filter Templates 範本
@msg a guide has no curvature circle 參考線沒有曲率圓
@msg the circle that matches the path there would reach past the canvas 在該處與路徑曲率相符的圓會超出畫布
@msg no circle passes through these points: two are the same or all three lie on one line 沒有圓通過這些點:有兩點相同,或三點共線
+@msg `at` must be "start" or "end" `at` 必須是 "start" 或 "end"
+@msg give exactly one of `through` and `toward` `through` 與 `toward` 必須且只能指定一個
+@msg no arc fits these points: two are the same or all three lie on one line 沒有弧形符合這些點:有兩點相同,或三點共線
+@msg give `at` only with `toward` `at` 只能與 `toward` 一起指定
@msg select at least two objects 請選取至少兩個物件
@msg exit isolation mode first 請先結束隔離模式
@msg no saved presets 沒有已儲存的預設集
diff --git a/crates/ui-egui/src/icon_data.rs b/crates/ui-egui/src/icon_data.rs
index 47a494e385..41f93d18df 100644
--- a/crates/ui-egui/src/icon_data.rs
+++ b/crates/ui-egui/src/icon_data.rs
@@ -45,6 +45,7 @@ pub static ICONS: &[(&str, &[u8])] = &[
("dc-anchor-smooth", include_bytes!("../../../assets/icons/dc-anchor-smooth.svg")),
("dc-appearance", include_bytes!("../../../assets/icons/dc-appearance.svg")),
("dc-arc", include_bytes!("../../../assets/icons/dc-arc.svg")),
+ ("dc-arc-three-point", include_bytes!("../../../assets/icons/dc-arc-three-point.svg")),
("dc-arrow-down", include_bytes!("../../../assets/icons/dc-arrow-down.svg")),
("dc-arrow-extend", include_bytes!("../../../assets/icons/dc-arrow-extend.svg")),
("dc-arrow-tip", include_bytes!("../../../assets/icons/dc-arrow-tip.svg")),
diff --git a/crates/ui-egui/src/icons.rs b/crates/ui-egui/src/icons.rs
index b1a62620d5..ef24ddb5e0 100644
--- a/crates/ui-egui/src/icons.rs
+++ b/crates/ui-egui/src/icons.rs
@@ -39,6 +39,7 @@ pub fn tool_icon(name: &str) -> &'static str {
"tool-touch-type" => "dc-touch-type",
"tool-line" => "dc-line",
"tool-arc" => "dc-arc",
+ "tool-three-point-arc" => "dc-arc-three-point",
"tool-spiral" => "tornado",
"tool-rect-grid" => "dc-rect-grid",
"tool-polar-grid" => "dc-polar-grid",
diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs
index cbfae34e8a..826b177938 100644
--- a/crates/ui-egui/src/menus/ui_commands.rs
+++ b/crates/ui-egui/src/menus/ui_commands.rs
@@ -838,7 +838,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
"retype.find",
"Find Matching Fonts",
"",
- "{more?: bool} show the Retype panel and list the fonts whose glyphs match the selected outlined text, compared and ranked as type.retypeFonts does (up to 96 loaded fonts, those of the document's live type first): ten, as Find Matching Fonts does, or with more: true the next five fonts the last search found (whatever is selected now; before any search, a first search), as Find more font matches does; the document does not change; a search with no path or compound path selected, or a more that is not true or false, is an error and leaves the list as it was; returns what retype.list returns",
+ "{more?: bool} show the Retype panel and list the fonts whose glyphs match the selected outlined text, compared and ranked as type.retypeFonts does (up to 96 loaded fonts, those of the document's live type first): ten, as Find Matching Fonts does (more false, omitted or null: a new search), or with more: true the next five fonts the last search found (whatever is selected now; before any search, a first search), as Find more font matches does; the document does not change; a search with no path or compound path selected, or a more other than true, false or null, is an error and leaves the list as it was; returns what retype.list returns",
),
(
"retype.list",
diff --git a/crates/ui-egui/src/panels/gradient.rs b/crates/ui-egui/src/panels/gradient.rs
index 7baaa062ab..e04c2780c1 100644
--- a/crates/ui-egui/src/panels/gradient.rs
+++ b/crates/ui-egui/src/panels/gradient.rs
@@ -347,7 +347,8 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
edit(app, json!({"reverse": true}), Live::Released);
}
});
- let radial = kind.is_centered() && placed;
+ // The default gradient (with nothing selected, or the Live Paint Bucket's) fits each object and has no aspect.
+ let radial = kind.is_centered() && placed && app.session.gradient_edit_has_objects(!app.session.fill_active);
ui.horizontal(|ui| {
icons::icon(ui, "scaling", 15.0, if radial { t.icon } else { t.text_disabled }).on_hover_text(tl!("Aspect Ratio"));
// A mirrored conic's negative aspect shows as its size; an edit keeps the mirror.
diff --git a/crates/ui-egui/src/panels/gradient/tests.rs b/crates/ui-egui/src/panels/gradient/tests.rs
index bbf833b1aa..f91d4fbcf5 100644
--- a/crates/ui-egui/src/panels/gradient/tests.rs
+++ b/crates/ui-egui/src/panels/gradient/tests.rs
@@ -433,6 +433,37 @@ fn the_aspect_field_keeps_a_mirrored_conic_mirrored() {
assert!((geom.aspect + 0.8).abs() < 1e-9 && geom.is_mirrored(), "{geom:?}");
}
+/// With nothing selected, and while the Live Paint Bucket is active, the Aspect Ratio field is
+/// dimmed: the default gradient fits each object and has no aspect, so typing in it changes
+/// nothing and reports no error.
+#[test]
+fn the_aspect_field_is_dimmed_for_the_default_gradient() {
+ for bucket in [false, true] {
+ let mut app = app(json!({"gradient": {"kind": "radial"}}));
+ if bucket {
+ app.select_tool("livePaintBucket");
+ } else {
+ app.run("select.set", json!({"ids": []})).unwrap();
+ }
+ let default = app.session.paint.fill.clone();
+ let mut p = Panel::new();
+ let texts = p.frame(&mut app, vec![], Modifiers::NONE);
+ // The aspect field is the first 100% (above Opacity's).
+ let field = texts
+ .iter()
+ .filter(|(t, _)| t == "100%")
+ .map(|(_, at)| *at)
+ .min_by(|a, b| a.y.total_cmp(&b.y))
+ .unwrap_or_else(|| panic!("the aspect field: {texts:?}"));
+ p.click(&mut app, field);
+ let key = |k, modifiers| Event::Key { key: k, physical_key: None, pressed: true, repeat: false, modifiers };
+ p.frame(&mut app, vec![key(egui::Key::A, Modifiers::COMMAND), Event::Text("80".into())], Modifiers::NONE);
+ p.frame(&mut app, vec![key(egui::Key::Enter, Modifiers::NONE)], Modifiers::NONE);
+ assert_eq!(app.session.paint.fill, default, "bucket {bucket}: the default gradient");
+ assert!(app.ui.status.is_empty(), "bucket {bucket}: {}", app.ui.status);
+ }
+}
+
/// The Type row's Diamond button (the fourth of five) makes the gradient a diamond, and the
/// Aspect Ratio field then edits its aspect.
#[test]
diff --git a/crates/ui-egui/src/panels/retype/tests.rs b/crates/ui-egui/src/panels/retype/tests.rs
index 8a7370bc5a..49f067c0b2 100644
--- a/crates/ui-egui/src/panels/retype/tests.rs
+++ b/crates/ui-egui/src/panels/retype/tests.rs
@@ -97,6 +97,10 @@ fn more_adds_fonts_until_none_is_left() {
}
assert_eq!(last["more"], json!(false), "{last}");
assert_eq!(app.run("retype.find", json!({"more": true})).unwrap(), last, "nothing is left to add");
+ // A null more is omitted: a new search lists the first ten again. A font added to the list
+ // tells the new search apart from adding more when ten or fewer fonts match.
+ app.ui.retype.fonts.push(super::Found { family: "Not Found".into(), style: "Regular".into(), matched: 0 });
+ assert_eq!(app.run("retype.find", json!({"more": null})).unwrap(), first);
// Before any search, more is a first search.
app.run("retype.reset", json!({})).unwrap();
assert_eq!(app.run("retype.find", json!({"more": true})).unwrap(), first);
diff --git a/crates/ui-egui/src/panels/swatches/actions.rs b/crates/ui-egui/src/panels/swatches/actions.rs
index 812a3ffb33..dc26c78550 100644
--- a/crates/ui-egui/src/panels/swatches/actions.rs
+++ b/crates/ui-egui/src/panels/swatches/actions.rs
@@ -276,6 +276,11 @@ pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) {
if menu_item(ui, tl!("Add Used Colors"), true, false) {
app.run("swatch.addUsedColors", json!({})).ok();
}
+ // The selected art's new colors, as global swatches its paints link to.
+ let art_selected = app.session.active().is_some_and(|st| !st.selection.objects.is_empty());
+ if menu_item(ui, tl!("Add Selected Colors"), art_selected, false) {
+ app.run("swatch.addUsedColors", json!({"selection": true, "global": true})).ok();
+ }
ui.separator();
if menu_item(ui, tl!("Sort by Name"), true, false) {
app.run("swatch.sortByName", json!({})).ok();
diff --git a/crates/ui-egui/src/panels/swatches/tests.rs b/crates/ui-egui/src/panels/swatches/tests.rs
index d2ac30a458..a3e7120c7a 100644
--- a/crates/ui-egui/src/panels/swatches/tests.rs
+++ b/crates/ui-egui/src/panels/swatches/tests.rs
@@ -1738,6 +1738,15 @@ fn click_menu_item(app: &mut VectorcraftApp, ctx: &egui::Context, label: &str) {
menu_frame(app, ctx, vec![button(false)]);
}
+/// Whether the panel menu's item `label` is enabled, as the accessibility tree reports it.
+fn menu_item_enabled(app: &mut VectorcraftApp, ctx: &egui::Context, label: &str) -> bool {
+ ctx.enable_accesskit();
+ let raw = egui::RawInput { screen_rect: Some(Rect::from_min_size(Pos2::ZERO, vec2(236.0, 700.0))), ..Default::default() };
+ let mut out = ctx.run_ui(raw, |ui| menu(app, ui));
+ out.textures_delta.clear();
+ footer_button(&out, label).1
+}
+
/// The panel menu's Color Group Options… opens on the selected color group when that group is the
/// whole selection; with nothing selected, a swatch alone, or a swatch or a second group beside the
/// group, it opens nothing. After OK, and after `swatch.renameGroup` run on its own or in a batch,
@@ -2016,3 +2025,44 @@ fn the_list_fills_a_tall_panel_above_its_footer() {
let loose = list(None);
assert!(loose.height() <= 150.5, "unsized, the list keeps its height: {loose:?}");
}
+
+/// The panel menu's Add Selected Colors adds only the selected art's new colors, as global swatches
+/// the art links to, in one undo step; with nothing selected it is off.
+#[test]
+fn add_selected_colors_adds_the_selection_colors_as_global_swatches() {
+ let mut app = app();
+ let rect = |app: &mut VectorcraftApp, color: &str| {
+ let id = app.run("shape.rectangle", json!({"x": 0, "y": 0, "width": 50, "height": 50})).unwrap()["id"].clone();
+ app.run("paint.setFill", json!({"ids": [id], "color": color})).unwrap();
+ app.run("paint.setStroke", json!({"ids": [id], "none": true})).unwrap();
+ id
+ };
+ let picked = rect(&mut app, "#abcdef");
+ rect(&mut app, "#fedcba");
+ let ctx = context();
+ let undo = |app: &VectorcraftApp| app.session.active().unwrap().history.undo.len();
+ app.run("select.set", json!({"ids": []})).unwrap();
+ let (before, steps) = (app.session.active().unwrap().doc.clone(), undo(&app));
+ assert!(!menu_item_enabled(&mut app, &ctx, "Add Selected Colors"), "off with nothing selected");
+ click_menu_item(&mut app, &ctx, "Add Selected Colors");
+ assert_eq!(app.session.active().unwrap().doc, before, "off with nothing selected");
+ assert_eq!(undo(&app), steps);
+ app.run("select.set", json!({"ids": [picked]})).unwrap();
+ assert!(menu_item_enabled(&mut app, &ctx, "Add Selected Colors"), "on with art selected");
+ let (before, steps) = (app.session.active().unwrap().doc.clone(), undo(&app));
+ click_menu_item(&mut app, &ctx, "Add Selected Colors");
+ let doc = &app.session.active().unwrap().doc;
+ let swatch = doc.swatch("R=171 G=205 B=239").expect("the selected art's color is a swatch");
+ assert!(swatch.global);
+ assert!(doc.swatch("R=254 G=220 B=186").is_none(), "unselected art adds nothing");
+ let fill = doc.node(vectorcraft_doc::NodeId(picked.as_u64().unwrap())).unwrap().appearance.fill_paint();
+ assert!(matches!(fill, Paint::Solid { swatch: Some(ref n), .. } if n == "R=171 G=205 B=239"), "{fill:?}");
+ assert_eq!(undo(&app), steps + 1);
+ // Run again, the color is in the panel already: nothing is added and no undo step is recorded.
+ let after = app.session.active().unwrap().doc.clone();
+ click_menu_item(&mut app, &ctx, "Add Selected Colors");
+ assert_eq!(app.session.active().unwrap().doc, after);
+ assert_eq!(undo(&app), steps + 1);
+ app.run("edit.undo", json!({})).unwrap();
+ assert_eq!(app.session.active().unwrap().doc, before);
+}
diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs
index 45cc02d07d..ba001f8cb9 100644
--- a/crates/ui-egui/src/toolbar.rs
+++ b/crates/ui-egui/src/toolbar.rs
@@ -37,7 +37,7 @@ pub const BASIC: &[(&str, &[&[&str]])] = &[
(
"Shapes",
&[
- &["rectangle", "roundedRectangle", "star", "lineSegment", "arc", "spiral", "rectangularGrid", "polarGrid", "flare"],
+ &["rectangle", "roundedRectangle", "star", "lineSegment", "arc", "threePointArc", "spiral", "rectangularGrid", "polarGrid", "flare"],
&["ellipse", "circle", "curvatureCircle"],
&["polygon"],
&["shaper"],
@@ -476,6 +476,8 @@ pub fn open_options(app: &mut VectorcraftApp, tool: &str) -> Result crate::dialogs::shapes::open_options(app, tool),
+ // The Three-Point Arc tool: whether the third point gives a direction.
+ vectorcraft_tools::three_point_arc::ID => Ok(crate::dialogs::three_point_arc_options::open(app)),
// The Flare tool: its options, which draw the next flare (OK draws none); with flares
// selected, the first one's settings, and OK draws the selected flares again.
"flare" => Ok(crate::dialogs::flare_options::open(app, None)),
diff --git a/docs/mcp.md b/docs/mcp.md
index ed6c7177fd..ba62592f84 100644
--- a/docs/mcp.md
+++ b/docs/mcp.md
@@ -825,6 +825,35 @@ from −100 to 100 and is 50 when left out with `lengthX` and `lengthY`, or 100
`` `baseAlong` must be one of x, y ``), as is a `slope` outside its range; the arc is not drawn and no undo step is
added.
+`shape.threePointArc {start: [x, y], end: [x, y], through?: [x, y], toward?: [x, y], at?: "start"|"end"}` draws an
+open circular arc from `start` to `end` and selects it. With `through`, the arc passes through that point. With
+`toward`, the arc leaves `start` heading toward that point, so the line from `start` to the point is the arc's tangent
+there. With `at: "end"`, the line from `end` to the point is the tangent at `end` instead. `at` is `"start"` when left
+out, and `at` with `through` is an error. The arc has no fill and the current stroke (black when the stroke is none),
+its ends are exactly the two points (it is not pixel-aligned), and it has a smooth anchor at the `through` point and
+further smooth anchors so that no curve of the path turns more than a quarter turn. The result is
+`{id, cx, cy, radius, sweep}`: the circle's center and radius, and the arc's turn in degrees, positive clockwise on the
+page. One undo removes the arc. The command returns an error and draws nothing when two of the points are the same,
+when the third point lies on the line through the ends, when the arc would reach past the canvas, when a point is not
+`[x, y]`, when both or neither of `through` and `toward` are given, when `at` is anything but `"start"` or `"end"`, and
+when `at` is given with `through`.
+
+The Three-Point Arc tool, in the Line Segment tool's group after the Arc tool, runs this command. A drag from one end to
+the other, or a click on each, places the ends; Shift keeps the second end at 45° steps from the first (from General ›
+Constrain Angle). A click on a third point, or a press dragged to it, then draws the arc through it. With the tool's
+`direction` option on, the third point gives the direction the arc leaves the first end in; with `mods.alt`, the
+direction is at the second end, and Shift keeps the direction at 45° steps. Three-Point Arc Tool Options (`tool.options`,
+or a double-click on the tool) sets `direction` with its Third Point Sets Direction box, and
+`]` (with or without Shift) switches it while the ends are placed; the option is saved with the preferences. Until the
+third point is placed, the tool shows the arc as a dashed outline, its center as a small cross, the direction line in
+direction mode and, with Measurement Labels on, the radius. Where no arc fits, the tool shows "Arc too large" by the
+pointer (nothing while the pointer is on an end), and a click there draws nothing and keeps the ends. Escape, and an
+edit, Undo or Redo made outside the tool, remove the ends.
+
+```json
+{"name":"run_command","arguments":{"command":"shape.threePointArc","params":{"start":[0,0],"end":[80,0],"through":[40,-40]}}}
+```
+
While a spiral is being dragged out with the Spiral tool, a `drag` event with `mods.alt` or `mods.cmd` keeps the
spiral's inner end at the distance from the center it had on the first modified `drag` event, and the outer end follows
the pointer. With `mods.alt` alone, dragging outward adds whole winds of four segments and dragging inward removes
@@ -1101,7 +1130,9 @@ art's colours (by default as global swatches the art links to).
`swatch.move {names, to?, group?}` reorders swatches or moves them into or out of a colour group (as dragging
them in the Swatches panel does); give colour group names instead to reorder the groups. Dropping a swatch on art
in the app runs `paint.setFill` (or `paint.setStroke`, the active proxy) with `ids: [the object under the pointer]`.
-The Swatches panel menu's commands: `swatch.addUsedColors {selection?, global?}`, `swatch.unused` (a query: the
+The Swatches panel menu's commands: `swatch.addUsedColors {selection?, global?}` (Add Used Colors sends `{}`; Add
+Selected Colors, on while art is selected, sends `{selection: true, global: true}`; a run with no new color records no
+undo step; with Global Edit on, the other members keep their colors), `swatch.unused` (a query: the
names Select All Unused selects; a spot swatch counts as used while an image placed from a DCS file has a plate of
its ink), `swatch.merge {names}` (the first is kept; gradient stops linked to the others drop their process
plates), `swatch.ungroup {name}`, `swatch.renameGroup {group, name}` (Color Group Options: renames the group alone
@@ -1673,7 +1704,9 @@ A conic gradient (`kind: "conic"`, also accepted as `angle` or `conical`) sweeps
draws the extent ellipse, aspect dot and center ring of a radial gradient, without a focal point; a `focal` given
for a conic gradient is an error. A negative `aspect` mirrors the sweep (counterclockwise), as reflecting the object
does; for the other kinds a negative `aspect` is an error. The Gradient panel's Aspect Ratio field and the aspect dot
-keep a mirrored sweep mirrored. Dither and Method apply as they do to a linear gradient. PDF export writes it as a
+keep a mirrored sweep mirrored. The default gradient for new art, and the Live Paint Bucket's, fits each object it
+paints and keeps no aspect, so `paint.editGradient` with an `aspect` is an error when it edits no object (nothing
+selected, the bucket's gradient without `ids`, or a fill edit of a Live Paint group without faces) and leaves the default as it was. Dither and Method apply as they do to a linear gradient. PDF export writes it as a
function-based shading (type 1) whose calculator function turns the angle into the ramp, and PDF import reads a
function-based shading whose color turns around the origin of its space back as a conic gradient, with its stops'
opacity, also when the origin lies outside the painted area; in a PDF/A file, or with more than 97 stops on its
@@ -8154,7 +8187,7 @@ snap the pointer as drawing tools do, so dragging a corner onto another object's
Every point a drawing tool places snaps the same way, through one snapper (#506): the Pen's and Curvature tool's
anchors, the shape tools' start and dragged corner or radius (`rectangle`,
`roundedRectangle`, `ellipse`, `polygon`, `star`, `lineSegment`, `arc`, `spiral`, `rectangularGrid`, `polarGrid`), the
-Type tool's click and frame, and a new artboard's corners. The Pencil ignores Smart Guides and Snap to Point and
+Three-Point Arc tool's ends and third point, the Type tool's click and frame, and a new artboard's corners. The Pencil ignores Smart Guides and Snap to Point and
shows no Smart Guides: its strokes and straight lines follow the hand (Snap to Grid and Snap to Pixel still move
their ends). The point lands on another object's anchor, centre or
path ("anchor", "center", "path"), else lines up with the anchors, edges and centres of the art and the artboards (a
@@ -12249,8 +12282,9 @@ path selected it is an error.
Window › Retype shows the Retype panel. Find Matching Fonts runs `retype.find {}`, which shows the panel, ranks up to
96 fonts and lists the first ten. Find more font matches, at the end of the list when `more` is true, runs
`retype.find {more: true}`, which adds the next five fonts that search found, whatever is selected now. Before any
-search, `retype.find {more: true}` runs a first search. A search that fails is an error and leaves the list as it
-was. Each row shows the font's family and style over a sample of the font. While live type is selected or edited, a
+search, `retype.find {more: true}` runs a first search. With `more` false, omitted or null, `retype.find` runs a new
+search; any other value than true, false or null is an error. A search that fails is an error and leaves the list as
+it was. Each row shows the font's family and style over a sample of the font. While live type is selected or edited, a
click on a row sets that font on it, as the font menus do; live type inside a selected group counts too. The list
stays when the selection changes.
diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md
index dbf5fcc03d..79ea0f99c7 100644
--- a/docs/target-app-parity.md
+++ b/docs/target-app-parity.md
@@ -738,6 +738,7 @@ since 2026-10-01.
- **Constrain Angle (#394):** General › Constrain Angle turns the arrow keys' axes (guides stay on the page's), holds Shift drags of the Selection, Direct Selection, Free Transform, Slice Selection, Reshape and Measure tools and the Pen's handles to the turned axes, and new rectangles, rounded rectangles, ellipses, grids, point and area type, Shift-drawn polygons and stars and the shape size dialogs are drawn along it with their bounding box turned; 0° and whole turns are exactly as before, quarter turns exact (). Tests: `tests_constrain_tools`, `tests_constrain_new` (engine), `geom` `constrain_axes` / `rotate_deg`, the shape, grid and type tool tests.
- **Arcs along General › Constrain Angle:** with a Constrain Angle other than 0° or a whole turn, an arc dragged out with the Arc tool and an arc placed from the Arc Segment Tool Options click dialog are drawn along the turned x and y axes, with their bounding box turned. The drag's box and Shift's equal lengths are measured along those axes, the reference point stays at the drag's corner or at the click, and F, C and ↑/↓ keep the turn. `shape.arc` takes an optional `rotation` (degrees clockwise, about `x1`, `y1` or about the reference point `x`, `y`); a `rotation` that is not a number is an error. At 0° and whole turns arcs are drawn as before, and quarter turns are exact. The help page () describes new objects being drawn along the turned axes; how the Arc tool's keys and reference point work with them is VectorCraft's own rule (tools `draw2::family::tests::arcs_follow_the_constrain_angle`; engine `constrain_angle_draws_a_dragged_arc_along_the_turned_axes`, `constrain_angle_turns_a_click_made_arc_about_its_reference_point`, `arc_rotation_turns_it_and_must_be_a_number`). Scores and hours unchanged.
- **Spirals turn as they are dragged, and along General › Constrain Angle:** a spiral dragged out with the Spiral tool turns about its center so that its outer end is at the pointer, so dragging around the center turns it, while Alt, Ctrl/Cmd, ↑/↓, Space and Escape work as before. A spiral placed from the Spiral dialog starts along the x axis turned by a Constrain Angle other than 0° or a whole turn, with its bounding box turned. `shape.spiral` takes an optional `rotation` (degrees clockwise about `cx`, `cy`); a `rotation` that is not a number is an error, and without one spirals are drawn as before. The help page () says that moving the pointer around in a curve during the drag turns the new spiral, and the help page () describes new objects being drawn along the turned axes. Putting the outer end exactly at the pointer, keeping the last direction while the pointer is within 0.01 pt of the center, and leaving a dragged spiral's direction to the pointer with Shift or a Constrain Angle are VectorCraft's own rules (tools `draw2::family::tests::spiral_drag_turns_the_spiral_to_the_pointer`; engine `a_dragged_spiral_turns_its_outer_end_to_the_pointer`, `constrain_angle_turns_a_click_made_spiral`, `spiral_rotation_turns_it_and_must_be_a_number`; UI `spiral_click_dialog_starts_along_the_constrain_angle`). Scores and hours unchanged.
+- **Three-Point Arc tool:** a new tool in the Line Segment tool's group, after the Arc tool, draws an open circular arc. A drag or two clicks place its ends (Shift keeps the second end at 45° steps), and a third click places a point the arc passes through. With Third Point Sets Direction on (the tool's Tool Options, or `]` while drawing), the third point gives the direction the arc leaves its first end in, or with Alt the direction at its second end. The tool previews the arc and its center, and with Measurement Labels on its radius, shows "Arc too large" where no arc fits, and draws the arc in one undo step with `shape.threePointArc {start, end, through | toward, at?}` (geom `shapes::tests::the_arc_through_a_point_passes_through_it`, `the_arc_leaving_along_a_direction_has_that_tangent`, `degenerate_points_give_no_arc`, `the_path_via_the_third_point_passes_through_it_exactly`; tools `three_point_arc::tests`; engine `tests::three_point_arc`; ui-egui `dialogs::three_point_arc_options::tests`). Scores and hours unchanged.
- **Shape commands refuse invalid options:** `shape.arc` refuses a `reference` that is not a whole number from 0 to 8, a `baseAlong` other than `x` or `y` (either case), null included for both, and a `slope` outside −100…100, in both of its forms; before, such a value drew the arc with reference point 0 or 8, the X axis or the nearest slope. `shape.rectangularGrid` and `shape.polarGrid` refuse a divider count that is not a whole number of at least 0; before, such a count was 5. Each error names the key, and nothing is drawn. Left-out values keep their defaults. These ranges are VectorCraft's own command rules (engine `draw2::shape_arc_rejects_an_invalid_reference_base_along_or_slope`, `draw2::shape_arc_takes_every_reference_point_and_either_base_axis`, `draw2::grid_divider_counts_reject_fractions_and_negatives`). Scores and hours unchanged.
- **Roughen at Size 0 keeps the outline:** with Size 0 (relative or absolute), Effect › Distort & Transform › Roughen… moves no point: each segment is split at the Detail spacing (fewer points past the anchor limit) into pieces of equal length on the segment itself, so the path keeps its outline, with Smooth or Corner points alike. A straight segment gets corner points without handles, and a curve gets smooth points whose handles follow it. Before, the points were joined by straight lines (Corner) or a smoothed curve through them (Smooth), which changed curved outlines. Existing documents with a Roughen of Size 0 on a curved path, or with Smooth points, draw differently. This is VectorCraft's own rule; what Roughen does is described in [Distort and transform effects](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/distort-and-transform-effects-in-illustrator.html) (effects `tests::roughen_at_size_0_keeps_the_outline_and_spaces_its_points_evenly`). Scores and hours unchanged.
@@ -1930,6 +1931,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- **Swatches:** names follow the colour model and are unique; Swatch Options (process/spot, Global, Gray/RGB/HSB/CMYK/Web, live preview); editing a global or spot swatch recolours every linked fill, stroke and text run in one undo step; multi-select and delete with confirmation; New Swatch and New Color Group dialogs (a group from the selected artwork's colours); swatches in colour groups convert, separate and count like any other. The Swatches panel selects ranges and whole groups, has a find field, and drags swatches to reorder, regroup or paint art; Add Used Colors, Select All Unused, Merge, Ungroup and Sort by Kind; a CMYK document keeps applied colours in CMYK. Swatch libraries: nine generated colour libraries, seven gradient libraries (among them Organic Fades, soft perceptually mixed multi-stop fades that thin out to transparent, and Holographic, seven opaque linear foils of narrow pastel and pearl bands and seven radial glows that fade out to a clear edge) and three pattern libraries (Geometric Patterns; Grit Textures with eight seamless grain, speckle, stipple, scratch and fleck tiles; and Optical Effects with eight of VectorCraft's own seamless wave, ring, warped-check, stripe, chevron and lens tiles; their swatches bring their patterns) in a library panel, saved as `.vcswatches`, `.gpl`, swatch exchange (`.ase`) or CSS, and loaded from `.vcswatches`, `.gpl` and `.ase` files (`.ase` both ways: RGB, CMYK, Lab and Gray; global, spot and process; groups) and from color books (`.acb`, read only: the RGB, CMYK or Lab colors of a book such as a Pantone book a user owns, named with its prefix and suffix, spot unless it says process, #831); `swatch.library.copyToUser` copies a loaded library into the User Defined folder without replacing a file, and a file with the same extension and bytes as a User Defined library opens as that library. Tints of global and spot colours ("Name 40%") stay linked and separate as a percentage of their plate. Spot colours can be defined in Lab (Spot Colors options). A built-in [Registration] swatch prints on every plate.
Right-clicking a swatch in either list or thumbnail view selects it without applying paint and offers Swatch Options…, Duplicate Swatch and Delete Swatch for that item. None, [Registration] and missing swatches disable these actions. Existing active-item multiselection is retained; actions still target only the clicked item. Evidence: `panels::swatches::tests::context_menu` harness tests cover all five views, selection, dialog dispatch, duplicate/delete and Undo. All 39 Swatches tests pass; the regression fails with the menu hooks removed. Rendered headless list and thumbnail menus were inspected, and a fresh local deep CodeRabbit review reported zero findings. Full workspace CI passed on Linux/WSL on the merged branch (all 13 gates), including the test-helper correction for the upstream compile error tracked in #7727; native Windows full CI has two unchanged engine-test failures. Scores and estimates unchanged.
Validation on 2026-11-15: native Windows formatting, workspace Clippy and all 39 focused Swatches tests passed. Windows full CI stopped at unchanged engine tests `tests::package::a_confined_package_names_files_outside_the_read_root_by_name` (slash-sensitive report assertion) and `tests::plugins::plugin_storage_behind_a_link_is_left_alone` (storage-link setup returned AlreadyExists). Both cases pass in the Linux/WSL full CI run, which passed all 13 gates. No engine or CI workflow changes are included.
+ The Swatches panel menu has Add Selected Colors, on while art is selected: it adds a swatch for each color of the selected art that the panel does not hold yet, as global swatches the art's matching paints link to, in one undo step ([the help page](https://helpx.adobe.com/illustrator/desktop/manage-colors/use-swatches/add-colors-to-swatches.html) describes the panel menu command that adds the selected artwork's colors). The swatch names and the colors it reads (fills, strokes, text, gradient stops, mesh points) are VectorCraft's own, as for Add Used Colors. Add Used Colors and Add Selected Colors record no undo step when there is no new color, and still end typing in progress as its own step. With Global Edit on, the members the command does not read keep their colors. Evidence: `add_selected_colors_adds_the_selection_colors_as_global_swatches` in `crates/ui-egui/src/panels/swatches/tests.rs`; `add_used_colors_with_no_new_color_records_no_undo_step`, `add_used_colors_with_no_new_color_ends_the_typing` and `add_selected_colors_in_global_edit_keeps_the_other_members_colors` in `crates/engine/src/tests/swatchcmds.rs`.
The panel's Delete Swatch and Swatch Options (footer buttons and panel menu), New Color Group and Save Swatch Library treat only None and [Registration] as reserved, so a user swatch or color group whose name starts with `[` can be deleted, edited, grouped and saved; selected names the document no longer holds are left out (`panels::swatches::tests::bracketed_user_swatches_and_groups_can_be_deleted_and_edited`).
Dragging swatches onto Delete Swatch deletes them ([the help page](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=136), Replace, merge, or delete swatches section, lists this drag as one of the ways to delete the selected swatches): a swatch or color group dragged from the Swatches panel, in any view, and released on the Delete Swatch button is deleted through `swatch.delete`, even while nothing was selected and the button is disabled for clicks. A swatch that is part of the selection carries the other selected swatches of its kind with it. VectorCraft's own rules: the drop asks first as a plain click does, and Alt does not skip the question; Cancel keeps everything, and OK deletes them in one undo step; None and [Registration] are never taken; the button is enabled while swatches are selected or while a swatch or group of the active document is being dragged, and it is outlined only while such a swatch or group is held over it, so a paint from another panel, art and a swatch dragged from another document delete nothing. Tests: `panels::swatches::tests::swatches_dropped_on_delete_swatch_are_deleted_after_asking`, `delete_swatch_ignores_other_drags`.
Dragging swatches onto New Swatch duplicates them ([the help page](https://helpx.adobe.com/illustrator/desktop/manage-colors/use-swatches/duplicate-swatches.html) gives this drag as another way to duplicate the selected swatches): a swatch dragged from the Swatches panel, in any view, and released on the New Swatch button is copied through `swatch.duplicate` without opening the New Swatch dialog. A swatch that is part of the selection carries the other selected swatches with it. VectorCraft's own rules: each copy goes just after its swatch and in its color group, named ` copy` and then ` copy 2`; the copies of one drop are one undo step and are selected; modifiers held on release do not change the drop; color groups, None and [Registration] are not duplicated; the button is outlined only while such a swatch of the active document is held over it, so a paint from another panel, art, a swatch dragged from another document and a swatch deleted during the drag duplicate nothing. Tests: `panels::swatches::tests::swatches_dropped_on_new_swatch_are_duplicated`, `new_swatch_ignores_other_drags`.
diff --git a/docs/ui-parity.md b/docs/ui-parity.md
index d94c8079c9..1418ed4cf8 100644
--- a/docs/ui-parity.md
+++ b/docs/ui-parity.md
@@ -349,6 +349,7 @@ tools, never checked side by side) isn't captured row by row.
| Sliders in dialogs and popups (Save for Web, raster export options, Preferences, the opacity popup) show their rail, filled up to the handle | done | #1483 |
| Rectangular Grid and Polar Grid click dialogs: size, divider counts with a skew slider each, Use Outside Rectangle As Frame / Create Compound Path From Ellipses, Fill Grid; kept as the tool's options, used by drags too | done | #1377. The options are the documented ones; how far a skew percentage moves the dividers and which way the radial skew turns are our own choice (the public documentation gives neither). The reference point locator is in the dialog, and a double-click on the tool opens it as the tool's Tool Options (next row) |
| Double-click the Line Segment, Arc, Rectangular Grid or Polar Grid tool: its Tool Options ([Rectangular Grid tool](https://helpx.adobe.com/illustrator/using/tool-techniques/rectangular-grid-tool.html) and [Arc tool](https://helpx.adobe.com/illustrator/using/tool-techniques/arc-tool.html) step 3, [Tools](https://helpx.adobe.com/illustrator/using/tools.html)) | done | #2691. The tool's click dialog without a place to draw: Line Segment's Length, Angle and Fill Line; Arc's lengths, Reference Point, Type, Base Along, Slope and Fill Arc; the grids' Reference Point, Default Size, dividers, skews and switches. OK draws nothing and sets what the next drag draws with (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and what a click's dialog opens at (with the Length, Angle and Default Size); Cancel changes nothing (`double_clicking_the_line_arc_and_grid_tools_opens_their_tool_options`) |
+| Three-Point Arc tool (VectorCraft addition), after the Arc tool: two ends, then a third point the open arc passes through or, with Third Point Sets Direction (its Tool Options, or `]` while drawing), the direction it leaves an end in; a preview with the center and, with Measurement Labels on, the radius; one undo step | done | `shape.threePointArc` (`crates/engine/src/cmd/create.rs`), the tool in `crates/tools/src/three_point_arc.rs`, the geometry in `crates/geom/src/shapes.rs` (`CircularArc`), and their tests; a VectorCraft addition, so it is not scored |
## Modifier keys and temporary tools