mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-01 02:35:37 +01:00
Tangent Circle Tool: the radius dialog draws nothing after its segments change
The dialog kept the segments it was opened on, so a control request that edited either path, or a switch to another document with the same paths, left it previewing and drawing a circle that no longer touched them. It now records the segments' places and the document, and shows the note with OK off when either segment differs or another document is active.
This commit is contained in:
1 parent
8bea29062f
commit
9bb2e0dbfe
4 files changed
+155
-28
No files matched your search
@@ -18,11 +18,12 @@
|
||||
//! segment's shape differs from the one they were found on. With the `askRadius` option on, a click
|
||||
//! on the second segment (not a drag, which sets the radius itself) opens the [`RADIUS_DIALOG`]
|
||||
//! instead of drawing: it starts at the radius of the circle found and draws the circle of the radius
|
||||
//! typed ([`radius_circle`]); the first segment stays picked until it does.
|
||||
//! typed ([`radius_circle`]); the first segment stays picked until it does. While the dialog is open,
|
||||
//! an edit to either segment leaves it without a circle ([`segments_unchanged`]).
|
||||
|
||||
use kurbo::{CubicBez, Shape};
|
||||
use serde_json::{Value, json};
|
||||
use vectorcraft_doc::NodeId;
|
||||
use vectorcraft_doc::{Document, NodeId};
|
||||
use vectorcraft_geom::{BezPath, ParamCurve, Point};
|
||||
use vectorcraft_pathops::addons::pathtools::{SegmentCircle, circles_of_radius, circles_through};
|
||||
|
||||
@@ -128,10 +129,24 @@ fn pick_at(cx: &ToolContext, p: Point) -> Option<Pick> {
|
||||
Some(Pick { id, subpath, segment, t, p: curve.eval(t), curve })
|
||||
}
|
||||
|
||||
/// A segment's place in the document: its path, subpath and index.
|
||||
type Place = (NodeId, usize, usize);
|
||||
|
||||
impl Pick {
|
||||
fn place(&self) -> Place {
|
||||
(self.id, self.subpath, self.segment)
|
||||
}
|
||||
}
|
||||
|
||||
/// The document's segment at `pick` as it is now: none when its path, subpath or segment is gone.
|
||||
fn segment_now(cx: &ToolContext, pick: &Pick) -> Option<CubicBez> {
|
||||
let sp = cx.doc.node(pick.id)?.path_data()?.subpaths.get(pick.subpath)?;
|
||||
(pick.segment < sp.segment_count()).then(|| sp.segment(pick.segment))
|
||||
segment_at(cx.doc, pick.place())
|
||||
}
|
||||
|
||||
/// The segment of `doc` at `place`: none when its path, subpath or segment is gone.
|
||||
fn segment_at(doc: &Document, (id, subpath, segment): Place) -> Option<CubicBez> {
|
||||
let sp = doc.node(id)?.path_data()?.subpaths.get(subpath)?;
|
||||
(segment < sp.segment_count()).then(|| sp.segment(segment))
|
||||
}
|
||||
|
||||
/// Whether the document's segment at `pick` still has the shape it had when it was picked.
|
||||
@@ -142,12 +157,17 @@ fn unchanged(cx: &ToolContext, pick: &Pick) -> bool {
|
||||
/// The segments a circle may touch when `second` is picked: it and the segments on either side of
|
||||
/// it, without `first`. None when `second` is the first segment again.
|
||||
fn second_set(cx: &ToolContext, first: &Pick, second: &Pick) -> Vec<CubicBez> {
|
||||
if (first.id, first.subpath, first.segment) == (second.id, second.subpath, second.segment) {
|
||||
second_set_at(cx.doc, first.place(), second.place())
|
||||
}
|
||||
|
||||
/// [`second_set`] for the segments of `doc` at `first` and `second`.
|
||||
fn second_set_at(doc: &Document, first: Place, second: Place) -> Vec<CubicBez> {
|
||||
if first == second {
|
||||
return vec![];
|
||||
}
|
||||
let Some(sp) = cx.doc.node(second.id).and_then(|n| n.path_data()).and_then(|p| p.subpaths.get(second.subpath)) else { return vec![] };
|
||||
let (id, subpath, i) = second;
|
||||
let Some(sp) = doc.node(id).and_then(|n| n.path_data()).and_then(|p| p.subpaths.get(subpath)) else { return vec![] };
|
||||
let n = sp.segment_count();
|
||||
let i = second.segment;
|
||||
let mut indices = vec![i];
|
||||
if i > 0 || sp.closed {
|
||||
indices.push((i + n - 1) % n);
|
||||
@@ -157,7 +177,7 @@ fn second_set(cx: &ToolContext, first: &Pick, second: &Pick) -> Vec<CubicBez> {
|
||||
}
|
||||
indices.sort_unstable();
|
||||
indices.dedup();
|
||||
let is_first = |k: usize| first.id == second.id && first.subpath == second.subpath && first.segment == k;
|
||||
let is_first = |k: usize| first == (id, subpath, k);
|
||||
indices.into_iter().filter(|k| *k < n && !is_first(*k)).map(|k| sp.segment(k)).collect()
|
||||
}
|
||||
|
||||
@@ -239,13 +259,26 @@ fn curve_of(v: &Value) -> Option<CubicBez> {
|
||||
Some(CubicBez::new(point_of(a)?, point_of(b)?, point_of(c)?, point_of(d)?))
|
||||
}
|
||||
|
||||
/// The [`RADIUS_DIALOG`]'s parameters for circle `c`, found by a click at `at` on `first` and the
|
||||
/// segments `second`, which `points` (from [`draw`]) draws: the segments, the click, the circle's
|
||||
/// radius and points, and the tolerance [`draw`] checked them with.
|
||||
fn dialog_params(first: &CubicBez, second: &[CubicBez], at: Point, c: &SegmentCircle, points: &Value, tol: f64) -> Value {
|
||||
fn place_json((id, subpath, segment): Place) -> Value {
|
||||
json!([id.0, subpath, segment])
|
||||
}
|
||||
|
||||
/// A place written by [`place_json`].
|
||||
fn place_of(v: &Value) -> Option<Place> {
|
||||
let [id, subpath, segment] = v.as_array()?.as_slice() else { return None };
|
||||
let index = |v: &Value| v.as_u64().and_then(|i| usize::try_from(i).ok());
|
||||
Some((NodeId(id.as_u64()?), index(subpath)?, index(segment)?))
|
||||
}
|
||||
|
||||
/// The [`RADIUS_DIALOG`]'s parameters for circle `c`, found by a click at `at` on `first` and on
|
||||
/// `picked`, whose segments a circle may touch are `second`, which `points` (from [`draw`]) draws:
|
||||
/// the segments and their places, the click, the circle's radius and points, and the tolerance
|
||||
/// [`draw`] checked them with.
|
||||
fn dialog_params(first: &Pick, picked: &Pick, second: &[CubicBez], at: Point, c: &SegmentCircle, points: &Value, tol: f64) -> Value {
|
||||
json!({
|
||||
"first": curve_json(first),
|
||||
"first": curve_json(&first.curve),
|
||||
"second": second.iter().map(curve_json).collect::<Vec<_>>(),
|
||||
"places": [place_json(first.place()), place_json(picked.place())],
|
||||
"at": point_json(at),
|
||||
"radius": c.circle.radius,
|
||||
"points": points,
|
||||
@@ -253,6 +286,19 @@ fn dialog_params(first: &CubicBez, second: &[CubicBez], at: Point, c: &SegmentCi
|
||||
})
|
||||
}
|
||||
|
||||
/// Whether the segments the [`RADIUS_DIALOG`] opened with parameters `p` holds are still those of
|
||||
/// `doc`: false when a path was edited or removed since the click, in another document, or for
|
||||
/// parameters the tool did not write.
|
||||
pub fn segments_unchanged(doc: &Document, p: &Value) -> bool {
|
||||
let check = || -> Option<bool> {
|
||||
let [first, second] = p.get("places")?.as_array()?.as_slice() else { return None };
|
||||
let (first, second) = (place_of(first)?, place_of(second)?);
|
||||
let second_then: Vec<CubicBez> = p.get("second")?.as_array()?.iter().map(curve_of).collect::<Option<_>>()?;
|
||||
Some(segment_at(doc, first)? == curve_of(p.get("first")?)? && second_then == second_set_at(doc, first, second))
|
||||
};
|
||||
check() == Some(true)
|
||||
}
|
||||
|
||||
/// The `shape.circleThroughPoints` parameters that draw the circle of `radius` the [`RADIUS_DIALOG`]
|
||||
/// opened with parameters `p` gives: at the radius the click found, the circle found; at any other,
|
||||
/// the circle of `radius` touching the second segments nearest the click, anywhere along the first
|
||||
@@ -432,7 +478,7 @@ impl Tool for TangentCircleTool {
|
||||
&& press.radius.is_none()
|
||||
&& let (Some(first), Action::Exec(_, drawn)) = (&self.first, &action)
|
||||
{
|
||||
let params = dialog_params(&first.curve, &press.second, press.at, &c, &drawn["points"], tol);
|
||||
let params = dialog_params(first, &press.pick, &press.second, press.at, &c, &drawn["points"], tol);
|
||||
return vec![Action::Dialog(RADIUS_DIALOG.into(), params)];
|
||||
}
|
||||
vec![action, Action::Notify(DRAWN.into())]
|
||||
@@ -702,6 +748,32 @@ mod tests {
|
||||
assert!(t.first.is_some());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_radius_dialog_knows_when_its_segments_changed() {
|
||||
let d = doc();
|
||||
let (sel, p) = (Selection::default(), paint());
|
||||
let cx = cx(&d, &sel, &p);
|
||||
let mut t = TangentCircleTool::default();
|
||||
t.set_option("askRadius", &json!(true));
|
||||
t.pointer(&cx, &ev(PointerKind::Down, 150.0, 101.0));
|
||||
t.pointer(&cx, &ev(PointerKind::Up, 150.0, 101.0));
|
||||
t.pointer(&cx, &ev(PointerKind::Down, 200.0, 139.0));
|
||||
let p = asked(&up(&mut t, &cx, &ev(PointerKind::Up, 200.0, 139.0)));
|
||||
assert!(segments_unchanged(&d, &p));
|
||||
assert!(segments_unchanged(&doc_at(100.0, 140.0), &p), "the same paths");
|
||||
// Either line moved, or another document: changed.
|
||||
for (a, b) in [(100.0, 150.0), (110.0, 140.0)] {
|
||||
assert!(!segments_unchanged(&doc_at(a, b), &p), "{a} {b}");
|
||||
}
|
||||
assert!(!segments_unchanged(&Document::new(500.0, 500.0), &p));
|
||||
// Parameters the tool did not write.
|
||||
for key in ["places", "first", "second"] {
|
||||
let mut q = p.clone();
|
||||
q[key] = json!("x");
|
||||
assert!(!segments_unchanged(&d, &q), "{key}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn two_clicks_draw_the_circle_tangent_at_the_first_click() {
|
||||
let d = doc();
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
//! tool's Ask For Circle Radius option is on. It starts at the radius of the circle the click found,
|
||||
//! and each radius previews on the canvas the circle of that radius touching the two segments
|
||||
//! nearest the click ([`tangent_circle::radius_circle`]). A radius that gives no circle there shows
|
||||
//! the tool's note and leaves OK off. OK draws the circle with `shape.circleThroughPoints` in one
|
||||
//! undo step, and with Auto-Update Default on also sets the tool's `radius` to the one given; Cancel
|
||||
//! draws nothing.
|
||||
//! the tool's note and leaves OK off, as does an edit to either segment after the click. OK draws
|
||||
//! the circle with `shape.circleThroughPoints` in one undo step, and with Auto-Update Default on
|
||||
//! also sets the tool's `radius` to the one given; Cancel draws nothing.
|
||||
|
||||
use egui::Ui;
|
||||
use serde_json::{Value, json};
|
||||
use vectorcraft_doc::Document;
|
||||
use vectorcraft_tools::addons::tangent_circle;
|
||||
|
||||
use crate::VectorcraftApp;
|
||||
@@ -28,13 +29,16 @@ const CLICK: &str = "__click";
|
||||
/// none) (private fields).
|
||||
const TRIED: &str = "__tried";
|
||||
const CIRCLE: &str = "__circle";
|
||||
/// The id of the document the click was in (`DocState::uid`; a private field).
|
||||
const DOC: &str = "__doc";
|
||||
/// The error for a radius outside the tool's range.
|
||||
const RADIUS_RANGE: &str = "`radius` must be from 0.01 to 1000000 pt";
|
||||
|
||||
/// Open the dialog on what the tool found (its [`tangent_circle::RADIUS_DIALOG`] parameters).
|
||||
pub(crate) fn open(app: &mut VectorcraftApp, p: &Value) {
|
||||
let radius = p.get("radius").cloned().unwrap_or(json!(tangent_circle::RADIUS));
|
||||
app.ui.dialog = Some(Dialog::new(KIND, json!({ "radius": radius, "preview": true, CLICK: p })));
|
||||
let doc = app.session.doc().ok().map(|s| s.uid);
|
||||
app.ui.dialog = Some(Dialog::new(KIND, json!({ "radius": radius, "preview": true, CLICK: p, DOC: doc })));
|
||||
}
|
||||
|
||||
pub(crate) const SPEC: DialogSpec = DialogSpec {
|
||||
@@ -42,11 +46,18 @@ pub(crate) const SPEC: DialogSpec = DialogSpec {
|
||||
body,
|
||||
confirm,
|
||||
preview: true,
|
||||
ok_enabled: Some(|_, d| circle_of(d).is_some_and(|c| c.is_ok_and(|c| c.is_some()))),
|
||||
ok_enabled: Some(|app, d| circle_of(doc(app, d), d).is_some_and(|c| c.is_ok_and(|c| c.is_some()))),
|
||||
min_width: 280.0,
|
||||
..DialogSpec::FORM
|
||||
};
|
||||
|
||||
/// The document the click was in, while it is the active one. A preview adds the circle to it and
|
||||
/// leaves the two segments as they are.
|
||||
fn doc<'a>(app: &'a VectorcraftApp, d: &Dialog) -> Option<&'a Document> {
|
||||
let clicked = d.fields.get(DOC).and_then(Value::as_u64)?;
|
||||
app.session.doc().ok().filter(|s| s.uid == clicked).map(|s| &*s.doc)
|
||||
}
|
||||
|
||||
/// Whether `r` is in the tool's radius range.
|
||||
fn in_range(r: f64) -> bool {
|
||||
let (lo, hi) = tangent_circle::RADIUS_RANGE;
|
||||
@@ -61,18 +72,23 @@ fn radius(d: &Dialog) -> Result<f64, String> {
|
||||
}
|
||||
|
||||
/// The circle last looked for, when it was looked for at the radius the dialog holds: its [`DRAW`]
|
||||
/// parameters, or none.
|
||||
fn circle_of(d: &Dialog) -> Option<Result<Option<Value>, String>> {
|
||||
/// parameters, or none. None too without the document clicked in (`doc`), or when either segment in
|
||||
/// it is no longer the one clicked (a control request edited or removed its path).
|
||||
fn circle_of(doc: Option<&Document>, d: &Dialog) -> Option<Result<Option<Value>, String>> {
|
||||
let r = match radius(d) {
|
||||
Ok(r) => r,
|
||||
Err(e) => return Some(Err(e)),
|
||||
};
|
||||
let click = d.fields.get(CLICK).unwrap_or(&Value::Null);
|
||||
if !doc.is_some_and(|doc| tangent_circle::segments_unchanged(doc, click)) {
|
||||
return Some(Ok(None));
|
||||
}
|
||||
(d.fields.get(TRIED).and_then(Value::as_f64) == Some(r)).then(|| Ok(d.fields.get(CIRCLE).filter(|c| !c.is_null()).cloned()))
|
||||
}
|
||||
|
||||
/// The circle at the radius the dialog holds, looked for again only when the radius changed.
|
||||
fn circle(d: &mut Dialog) -> Result<Option<Value>, String> {
|
||||
if let Some(found) = circle_of(d) {
|
||||
fn circle(doc: Option<&Document>, d: &mut Dialog) -> Result<Option<Value>, String> {
|
||||
if let Some(found) = circle_of(doc, d) {
|
||||
return found;
|
||||
}
|
||||
let r = radius(d)?;
|
||||
@@ -88,7 +104,7 @@ fn body(app: &mut VectorcraftApp, ui: &mut Ui, d: &mut Dialog) -> bool {
|
||||
widgets::label_row(ui, tl!("Radius:"), LABEL_W, |ui| {
|
||||
form::length_within(ui, d, "radius", unit, FIELD_W, None);
|
||||
});
|
||||
let note = match circle(d) {
|
||||
let note = match circle(doc(app, d), d) {
|
||||
Ok(Some(points)) => {
|
||||
form::preview_without_check(app, d, "Tangent Circle", DRAW, points);
|
||||
return false;
|
||||
@@ -107,7 +123,7 @@ fn body(app: &mut VectorcraftApp, ui: &mut Ui, d: &mut Dialog) -> bool {
|
||||
fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result<Value, String> {
|
||||
let mut d = d.clone();
|
||||
let r = radius(&d)?;
|
||||
let points = circle(&mut d)?.ok_or_else(|| tangent_circle::NO_CIRCLE.to_string())?;
|
||||
let points = circle(doc(app, &d), &mut d)?.ok_or_else(|| tangent_circle::NO_CIRCLE.to_string())?;
|
||||
let auto = app.session.tool_options_of(tangent_circle::ID).get("autoUpdateDefault").and_then(Value::as_bool) == Some(true);
|
||||
form::commit_preview(app, DRAW, points)?;
|
||||
if auto && in_range(r) {
|
||||
@@ -221,6 +237,44 @@ mod tests {
|
||||
assert_eq!(count(&app), paths + 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn another_document_or_a_segment_changed_after_the_click_gives_no_circle() {
|
||||
let mut app = VectorcraftApp::new(Session::new(), Default::default());
|
||||
app.run("file.new", json!({"width": 500, "height": 500})).unwrap();
|
||||
for y in [100, 140] {
|
||||
app.run("path.create", json!({"anchors": [{"x": 100, "y": y}, {"x": 300, "y": y}]})).unwrap();
|
||||
}
|
||||
app.session.select_tool(tool::ID, ViewInfo::default()).unwrap();
|
||||
app.run("tool.setOption", json!({"tool": tool::ID, "key": "askRadius", "value": true})).unwrap();
|
||||
let paths = count(&app);
|
||||
click(&mut app, 150.0, 100.0, false);
|
||||
click(&mut app, 200.0, 140.0, false);
|
||||
frame(&mut app);
|
||||
assert!(ok_enabled(&app));
|
||||
assert_eq!(count(&app), paths + 1);
|
||||
// Clicked in another document than the active one: no circle and OK off, until that one is
|
||||
// active again.
|
||||
let clicked = app.ui.dialog.as_ref().unwrap().fields[super::DOC].clone();
|
||||
assert_eq!(clicked, json!(app.session.doc().unwrap().uid));
|
||||
app.ui.dialog.as_mut().unwrap().fields.insert(super::DOC.into(), json!(clicked.as_u64().unwrap() + 1));
|
||||
assert!(frame(&mut app).contains(tool::NO_CIRCLE));
|
||||
assert_eq!(count(&app), paths);
|
||||
assert!(!ok_enabled(&app));
|
||||
app.ui.dialog.as_mut().unwrap().fields.insert(super::DOC.into(), clicked);
|
||||
frame(&mut app);
|
||||
assert!(ok_enabled(&app));
|
||||
assert_eq!(count(&app), paths + 1);
|
||||
// The dialog holds a first segment the document no longer has (as when a control request
|
||||
// moves that line): no circle, nothing previewed, OK off and refused.
|
||||
let d = app.ui.dialog.as_mut().unwrap();
|
||||
d.fields.get_mut(super::CLICK).unwrap()["first"] = json!([[100.0, 110.0], [100.0, 110.0], [300.0, 110.0], [300.0, 110.0]]);
|
||||
assert!(frame(&mut app).contains(tool::NO_CIRCLE));
|
||||
assert_eq!(count(&app), paths);
|
||||
assert!(!ok_enabled(&app));
|
||||
assert_eq!(crate::dialogs::confirm(&mut app), Err(tool::NO_CIRCLE.to_string()));
|
||||
assert_eq!(count(&app), paths);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_radius_dialog_previews_says_when_there_is_none_cancels_and_draws_on_ok() {
|
||||
let mut app = VectorcraftApp::new(Session::new(), Default::default());
|
||||
|
||||
+3
-2
@@ -14574,8 +14574,9 @@ Tools:
|
||||
which sets the radius, draws at once. The dialog's Radius starts at the radius of the circle found, and each radius
|
||||
previews the circle of that radius touching the second segments nearest the click, anywhere along the first segment
|
||||
(at the radius it opened with, the circle found). A radius that gives no circle there shows the note and leaves OK
|
||||
off, and one outside 0.01 to 1000000 pt (or not a number, as `ui.dialog.set` can give) shows the radius error, except
|
||||
the radius the dialog opened with; OK then gives that error and the dialog stays open. OK draws the circle in one undo
|
||||
off, as do an edit to either segment's path after the click and another active document; one outside 0.01 to
|
||||
1000000 pt, typed or set (or not a number, as `ui.dialog.set` can give), shows the radius error, except the radius the
|
||||
dialog opened with; OK then gives that error and the dialog stays open. OK draws the circle in one undo
|
||||
step, with `shape.circleThroughPoints`, and with `autoUpdateDefault` on also sets `radius` to the radius given when
|
||||
it is in that range. Cancel draws nothing, leaves no undo step and
|
||||
keeps the first segment picked.
|
||||
|
||||
@@ -2997,7 +2997,7 @@ A VectorCraft addition, not a feature of the reference app, so no area score mov
|
||||
|
||||
A VectorCraft addition, so no area score moves. The Tangent Circle Tool (`tangentCircle`; Object › Plug-ins › Path Precision Tools and the All Tools drawer) draws a circle on two clicked path segments: tangent to the first at the point clicked (its center on the normal there) and touching the second segment or one beside it on its subpath, the touch nearest the pointer winning. Shift gives the circle the tool's radius, and a drag from the second segment sets the radius to the drag's length (Shift: steps of 1, 2 or 5 times a power of 10 pt, at least 4 screen pixels; Cmd/Ctrl: a tenth of the movement); with a radius the circle may touch the first segment anywhere along it. Before the click the circle shows with its center, radii and radius, or a note says there is none. The circles are found by sampling the distance to the second segments along the first segment's normal (or along the first segment, for a radius) and taking the places where it equals the radius (samples, bisection where it crosses, and a search where it only touches). Left out are circles whose nearest point of the second segments is not on the circle (within a millionth of the radius: where the first segment turns back on itself the distance jumps past the radius without a touch), circles that cross the first segment, circles that touch both segments at one point, circles without a finite radius above 0, circles too small or too large for three of their points to give them back in floating point, and circles that would reach past the canvas; a circle found twice (the same center, touching the first segment at the same point) is kept once. The circle is a new ellipse with the current paint, one undo step; the first segment stays picked until it is drawn, also when drawing fails or the press is canceled, and the circles are looked for again when a live preview, or one that was canceled, changes either segment without an undo step (a changed first segment is forgotten). Tests: `tangent_circle::tests` in `vectorcraft-pathops` (parallel and crossing lines, a curved second segment, a corner's fillet, lines twice the radius apart, a touch between the places tried, the ends of a line with its handles on its anchors, a circle that crosses the first segment, a first segment that turns back, no circle), `addons::tangent_circle::tests` in `vectorcraft-tools` (two clicks, Shift and the radius option, a drag with Shift and Cmd/Ctrl, no circle and Escape, a canceled press, a canceled preview, a circle its three points cannot draw, a circle past the canvas), the session test for a failed draw in `vectorcraft-engine` and the Path Precision Tools menu, options, drawer and catalog tests in `vectorcraft-ui-egui`. Commands: `docs/mcp.md` › Path Precision Tools add-on.
|
||||
|
||||
Ask For Circle Radius and Auto-Update Default (2026-11-20): two options of the tool (`askRadius`, `autoUpdateDefault`, both off to start with). With Ask For Circle Radius on, a click on the second segment that finds a circle, with or without Shift, opens a Tangent Circle dialog at that circle's radius instead of drawing; a drag draws at once. Each radius typed previews the circle of that radius nearest the click, a radius with no circle there shows the note and leaves OK off, a radius typed outside 0.01 to 1,000,000 pt (other than the click's own) shows an error and leaves OK off, OK draws the circle in one undo step, and Cancel draws nothing and keeps the first segment picked. With Auto-Update Default on, OK also makes the radius given the tool's Shift radius. Tests: `ask_for_circle_radius_opens_the_dialog_after_a_click_but_not_after_a_drag` in `vectorcraft-tools` and `the_radius_dialog_previews_says_when_there_is_none_cancels_and_draws_on_ok` and `a_radius_typed_outside_the_tool_range_shows_the_error_and_leaves_ok_off` in `vectorcraft-ui-egui`.
|
||||
Ask For Circle Radius and Auto-Update Default (2026-11-20): two options of the tool (`askRadius`, `autoUpdateDefault`, both off to start with). With Ask For Circle Radius on, a click on the second segment that finds a circle, with or without Shift, opens a Tangent Circle dialog at that circle's radius instead of drawing; a drag draws at once. Each radius typed previews the circle of that radius nearest the click, a radius with no circle there, an edit to either segment after the click, or another active document, shows the note and leaves OK off, a radius typed outside 0.01 to 1,000,000 pt (other than the click's own) shows an error and leaves OK off, OK draws the circle in one undo step, and Cancel draws nothing and keeps the first segment picked. With Auto-Update Default on, OK also makes the radius given the tool's Shift radius. Tests: `ask_for_circle_radius_opens_the_dialog_after_a_click_but_not_after_a_drag` and `the_radius_dialog_knows_when_its_segments_changed` in `vectorcraft-tools`, and `the_radius_dialog_previews_says_when_there_is_none_cancels_and_draws_on_ok`, `a_radius_typed_outside_the_tool_range_shows_the_error_and_leaves_ok_off` and `another_document_or_a_segment_changed_after_the_click_gives_no_circle` in `vectorcraft-ui-egui`.
|
||||
|
||||
## Path Precision Tools add-on: Trim at Crossings (2026-11-13)
|
||||
|
||||
|
||||
Reference in new issue
Block a user