From ac365436ac3394471fb1661359f30a4d171f2f60 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 15:46:39 -0800 Subject: [PATCH 1/7] Shapes: the Circle tool draws a circle from its center through a point MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With From Center on (a Control bar checkbox, or the tool option fromCenter), the Circle tool's first point is the circle's center and its outline passes through the second point, which follows the pointer. A drag from the center, or a click on the center and a click on the outline, draws the circle. The second point snaps to Smart Guides and anchor points as the tool's other points do, so a circle centered on one corner of a rectangle can pass exactly through the opposite corner, with the diagonal as its radius. Shift keeps the second point at 45° steps from the center, and Alt rounds the diameter to the rulers' ticks. A second click on the center places nothing. The setting in force when the first point is placed applies to that circle, and the setting is saved with the preferences. Each circle is one undo step. shape.circleThroughPoints takes center: [x, y] with one point in points and draws the circle at the center through that point. A point on the center, and coordinates whose distance overflows, are refused with their own messages. tool.setOption refuses a fromCenter that is not true or false and any other Circle tool option; both errors are translated. Requested by Auriga on the community Discord. Part of #7178. --- ROADMAP.md | 1 + crates/engine/src/cmd/create.rs | 44 +++++-- crates/engine/src/tests/circle_through.rs | 63 ++++++++++ crates/engine/src/tests/toolsettings.rs | 18 +++ crates/engine/src/tooling.rs | 3 + crates/tools/src/circle.rs | 133 +++++++++++++++++----- crates/tools/src/circle/tests.rs | 124 +++++++++++++++++++- crates/tools/src/settings.rs | 2 + crates/ui-egui/src/chrome/tests.rs | 25 +++- crates/ui-egui/src/i18n/bg.tsv | 1 + crates/ui-egui/src/i18n/bs.tsv | 1 + crates/ui-egui/src/i18n/ca.tsv | 4 + crates/ui-egui/src/i18n/cs.tsv | 4 + crates/ui-egui/src/i18n/da.tsv | 4 + crates/ui-egui/src/i18n/de.tsv | 4 + crates/ui-egui/src/i18n/el.tsv | 4 + crates/ui-egui/src/i18n/es.tsv | 4 + crates/ui-egui/src/i18n/fi.tsv | 4 + crates/ui-egui/src/i18n/fr.tsv | 4 + crates/ui-egui/src/i18n/gu.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 4 + crates/ui-egui/src/i18n/hu.tsv | 4 + crates/ui-egui/src/i18n/id.tsv | 1 + crates/ui-egui/src/i18n/it.tsv | 4 + crates/ui-egui/src/i18n/ja.tsv | 4 + crates/ui-egui/src/i18n/ka.tsv | 4 + crates/ui-egui/src/i18n/ko.tsv | 4 + crates/ui-egui/src/i18n/nl.tsv | 4 + crates/ui-egui/src/i18n/pl.tsv | 4 + crates/ui-egui/src/i18n/pt-br.tsv | 4 + crates/ui-egui/src/i18n/ru.tsv | 4 + crates/ui-egui/src/i18n/sv.tsv | 4 + crates/ui-egui/src/i18n/tests.rs | 17 +++ crates/ui-egui/src/i18n/tr.tsv | 4 + crates/ui-egui/src/i18n/uk.tsv | 4 + crates/ui-egui/src/i18n/vi.tsv | 4 + crates/ui-egui/src/i18n/zh-hans.tsv | 4 + crates/ui-egui/src/i18n/zh-hant.tsv | 4 + crates/ui-egui/src/toolbar.rs | 22 +++- docs/mcp.md | 15 +++ 40 files changed, 524 insertions(+), 43 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index e9d2cc56b5..8d6ee9ceb7 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -139,6 +139,7 @@ Ranked; detail in [docs/roadmap.md](docs/roadmap.md) and [docs/gaps.md](docs/gap - 2026-11-02: Mouse wheel over a closed font-family field in Character, Properties or Control changes selected text through the family list using saved font filters (excluding search text), one undo step per notch, stopping at the ends (#5253). Scores and estimates unchanged. - 2026-11-15: Circle through three points: three Shift-clicks with the Ellipse tool, or `shape.circleThroughPoints` with three points or three selected anchor points, draw the circle whose edge passes through them, with the current paint, in one undo step; after two points the tool previews the circle through the pointer, and two points that are the same or three on one line are refused with a message. Scores and estimates unchanged. - 2026-11-17: Circle tool (after the Ellipse tool in its group): two clicks or a drag draw the circle on that diameter, and a click followed by a drag from a second point to a third draws the circle through the three; Shift keeps the diameter at 45° steps, Alt rounds a two-point circle's diameter to the rulers' ticks at the current zoom, points snap to Smart Guides, and the tool shows the circle, its center, its radii and its diameter until the release, or "Circle too large" for points on one line or a circle past the canvas. `shape.circleThroughPoints` also takes two points or two selected anchor points as the ends of a diameter. One undo step per circle. A VectorCraft addition: headline numbers unchanged. +- 2026-11-17: Circle tool, From Center (a Control bar checkbox, `tool.setOption` `fromCenter`): the first point is the circle's center and the outline passes through the pointer, which snaps to Smart Guides and anchor points, so a circle centered on one corner of a rectangle can pass through the opposite corner; `shape.circleThroughPoints {center, points: [[x, y]]}` draws it. One undo step per circle. A VectorCraft addition: headline numbers unchanged. - 2026-10-31: Pattern libraries: Window › Swatch Libraries › Patterns and the Swatches panel's library menu open Geometric Patterns, a built-in library of eleven pattern swatches (dots, stripes, checks, a grid and shapes); clicking one adds its pattern and swatch to the document, once, and applies it to the active fill or stroke (`swatch.library.add`). - 2026-11-11: Pattern libraries: Patterns › Grit Textures, a second built-in pattern library, holds eight seamless black textures (Fine Grain, Coarse Grit, Sand, Speckle, Stipple, Scratches, Sparse Flecks and Dense Flecks) on tiles of 18 to 36 pt, each drawn the same way every time; marks that reach past a tile edge continue on the next tile, so the tiles join without a seam (`swatch.library.add`). Scores and estimates unchanged. - 2026-11-11: Pattern libraries: Patterns › Optical Effects, a third built-in pattern library, of VectorCraft's own designs, holds eight black wave, moiré and op-art tiles (Sine Bands, Ripple Lines, Interference Rings, Offset Rings, Warped Checks, Pinched Stripes, Chevron Pulse and Radiating Lenses) of 32 to 48 pt, each drawn the same way every time; each tile is one period of its design, and art that reaches past a tile edge continues on the next tile, so the tiles join without a seam (`swatch.library.add`). Scores and estimates unchanged. diff --git a/crates/engine/src/cmd/create.rs b/crates/engine/src/cmd/create.rs index e9fcad8883..7a5a3633af 100644 --- a/crates/engine/src/cmd/create.rs +++ b/crates/engine/src/cmd/create.rs @@ -62,7 +62,7 @@ pub fn specs() -> Vec { "Circle Through Points", [], None, - "{points?: [[x, y], [x, y]] or [[x, y], [x, y], [x, y]] (two: the ends of a diameter; left out: the two or three selected anchor points, where a path selected whole counts all its anchors and selected segments' ends do not count)} → {id, cx, cy, radius}: a circle with the current paint whose edge passes through the points, not pixel-aligned even while Align New Objects to Pixel Grid is on; two points that are the same, three on one line, or a circle reaching past the canvas are an error, and nothing is drawn", + "{points?: [[x, y], [x, y]] or [[x, y], [x, y], [x, y]] (two: the ends of a diameter; left out: the two or three selected anchor points, where a path selected whole counts all its anchors and selected segments' ends do not count), center?: [x, y] (the circle's center; `points` then holds the one point its edge passes through, [[x, y]])} → {id, cx, cy, radius}: a circle with the current paint whose edge passes through the points, not pixel-aligned even while Align New Objects to Pixel Grid is on; two points that are the same, a point on `center`, three on one line, or a circle reaching past the canvas are an error, and nothing is drawn", has_doc, circle_through_points ), @@ -418,12 +418,32 @@ fn ellipse(s: &mut Session, p: &Value) -> Result { /// undo step, named as an Ellipse tool drag is. fn circle_through_points(s: &mut Session, p: &Value) -> Result { const C: &str = "shape.circleThroughPoints"; - let points = match p.get("points").filter(|v| !v.is_null()) { - Some(v) => two_or_three_points(v).ok_or_else(|| bad(C, "`points` must be two or three [x, y] pairs of numbers"))?, - None => selected_anchor_points(s)?.ok_or_else(|| bad(C, "direct-select two or three anchor points, or give `points`"))?, + const SAME: &str = "no circle passes through these points: two are the same or all three lie on one line"; + let (center, radius) = match p.get("center").filter(|v| !v.is_null()) { + // From a center: the circle at `center` whose edge passes through the one point. + Some(c) => { + let one = p.get("points").and_then(Value::as_array).and_then(|v| match v.as_slice() { + [q] => pair(q), + _ => None, + }); + let (c, q) = pair(c).zip(one).ok_or_else(|| bad(C, "`center` must be an [x, y] pair of numbers, with one [x, y] pair in `points`"))?; + let r = c.distance(q); + if r == 0.0 { + return Err(bad(C, "the point in `points` is on `center`")); + } + if !r.is_finite() { + return Err(bad(C, "result would exceed the canvas (coordinates out of range)")); + } + (c, r) + } + None => { + let points = match p.get("points").filter(|v| !v.is_null()) { + Some(v) => two_or_three_points(v).ok_or_else(|| bad(C, "`points` must be two or three [x, y] pairs of numbers"))?, + None => selected_anchor_points(s)?.ok_or_else(|| bad(C, "direct-select two or three anchor points, or give `points`"))?, + }; + shapes::circle_through_points(&points).ok_or_else(|| bad(C, SAME))? + } }; - let (center, radius) = shapes::circle_through_points(&points) - .ok_or_else(|| bad(C, "no circle passes through these points: two are the same or all three lie on one line"))?; let r = Rect::new(center.x - radius, center.y - radius, center.x + radius, center.y + radius); let live = LiveShape::Ellipse { w: r.width(), h: r.height(), pie: (0.0, 360.0), xf: Affine::translate(r.origin().to_vec2()) }; // Not pixel-aligned: the circle stays through the points. @@ -434,13 +454,17 @@ fn circle_through_points(s: &mut Session, p: &Value) -> Result { Ok(out) } +/// The point an `[x, y]` pair of finite numbers gives. +fn pair(v: &Value) -> Option { + match v.as_array().map(Vec::as_slice) { + Some([x, y]) => x.as_f64().zip(y.as_f64()).filter(|(x, y)| x.is_finite() && y.is_finite()).map(|(x, y)| Point::new(x, y)), + _ => None, + } +} + /// The two or three points `[[x, y], [x, y]]` or `[[x, y], [x, y], [x, y]]` holds, each pair two /// finite numbers. fn two_or_three_points(v: &Value) -> Option> { - let pair = |v: &Value| match v.as_array().map(Vec::as_slice) { - Some([x, y]) => x.as_f64().zip(y.as_f64()).filter(|(x, y)| x.is_finite() && y.is_finite()).map(|(x, y)| Point::new(x, y)), - _ => None, - }; match v.as_array() { Some(pairs) if matches!(pairs.len(), 2 | 3) => pairs.iter().map(pair).collect(), _ => None, diff --git a/crates/engine/src/tests/circle_through.rs b/crates/engine/src/tests/circle_through.rs index e91c48e76a..462838a979 100644 --- a/crates/engine/src/tests/circle_through.rs +++ b/crates/engine/src/tests/circle_through.rs @@ -123,6 +123,47 @@ fn two_points_are_the_ends_of_a_diameter() { assert_eq!((undo_len(&s), object_count(&s)), (undo, count)); } +/// With `center`, the circle is centered there and its edge passes through the one point in +/// `points`: from the bottom-right corner (200, 200) of a 100 pt square through its top-left +/// corner (100, 100), the radius is the square's diagonal, in one undo step. A point on the center +/// and a circle past the canvas are refused, and so is a `center` or `points` that is not one +/// `[x, y]` pair of finite numbers; nothing is drawn and no undo step is recorded. +#[test] +fn a_center_and_a_point_on_the_edge_give_the_circle() { + let mut s = session(); + let undo = undo_len(&s); + let out = s.execute(C, &json!({"center": [200, 200], "points": [[100, 100]]})).unwrap(); + let r = 100.0 * std::f64::consts::SQRT_2; + assert_eq!((out["cx"].as_f64(), out["cy"].as_f64()), (Some(200.0), Some(200.0)), "{out}"); + assert!((out["radius"].as_f64().unwrap() - r).abs() < 1e-12, "{out}"); + let id = id_of(&out); + assert!(bounds_are(&s, id, vectorcraft_geom::Rect::new(200.0 - r, 200.0 - r, 200.0 + r, 200.0 + r))); + assert!(farthest_from_path(&s, id, &[Point::new(100.0, 100.0)]) < r * 3e-4); + assert_eq!(s.doc().unwrap().selection.objects, [id]); + assert_eq!(undo_len(&s), undo + 1); + let (undo, count) = (undo_len(&s), object_count(&s)); + let e = s.execute(C, &json!({"center": [30, 30], "points": [[30, 30]]})).unwrap_err().to_string(); + assert!(e.contains("the point in `points` is on `center`"), "{e}"); + // Past the canvas, and finite coordinates whose distance overflows to infinity. + for (center, point) in [(json!([0, 0]), json!([4_100_000, 0])), (json!([-1e308, -1e308]), json!([1e308, 1e308]))] { + let e = s.execute(C, &json!({ "center": center, "points": [point] })).unwrap_err().to_string(); + assert!(e.contains("result would exceed the canvas"), "{center} {point}: {e}"); + } + for (center, points) in [ + (json!([0, 0]), json!([[10, 0], [0, 10]])), + (json!([0, 0]), json!([])), + (json!([0, 0]), Value::Null), + (json!([0, 0]), json!([[10, "0"]])), + (json!([0]), json!([[10, 0]])), + (json!("0,0"), json!([[10, 0]])), + (json!([0, 0, 1]), json!([[10, 0]])), + ] { + let e = s.execute(C, &json!({ "center": center, "points": points })).unwrap_err().to_string(); + assert!(e.contains("`center` must be an [x, y] pair of numbers, with one [x, y] pair in `points`"), "{center} {points}: {e}"); + } + assert_eq!((undo_len(&s), object_count(&s)), (undo, count)); +} + /// Points that are not two or three pairs of finite numbers are an error, not a fallback. #[test] fn malformed_points_are_refused() { @@ -214,6 +255,28 @@ fn click(s: &mut Session, mods: Mods, x: f64, y: f64) { } } +/// The Circle tool with From Center set through `tool.setOption`: a click on the center and a +/// click on the edge draw the circle, in one undo step. `fromCenter` must be true or false, and +/// the tool has no other option; a refused value changes nothing. +#[test] +fn the_circle_tool_draws_from_its_center() { + let mut s = session(); + s.select_tool("circle", view()).unwrap(); + let e = s.set_tool_option_cmd(&json!({"key": "fromCenter", "value": "yes"})).unwrap_err(); + assert!(e.contains("`fromCenter` must be true or false"), "{e}"); + assert!(s.set_tool_option_cmd(&json!({"key": "radius", "value": 5})).is_err()); + assert_eq!(s.tool_options()["fromCenter"], json!(false)); + s.set_tool_option_cmd(&json!({"key": "fromCenter", "value": true})).unwrap(); + assert_eq!(s.tool_options()["fromCenter"], json!(true)); + let undo = undo_len(&s); + click(&mut s, Mods::default(), 200.0, 200.0); + click(&mut s, Mods::default(), 100.0, 100.0); + assert_eq!(undo_len(&s), undo + 1); + let id = *s.doc().unwrap().selection.objects.first().unwrap(); + let r = 100.0 * std::f64::consts::SQRT_2; + assert!(bounds_are(&s, id, vectorcraft_geom::Rect::new(200.0 - r, 200.0 - r, 200.0 + r, 200.0 + r))); +} + /// With the Ellipse tool, three Shift-clicks draw the circle through the three points, in one /// undo step; Escape drops the points placed so far. #[test] diff --git a/crates/engine/src/tests/toolsettings.rs b/crates/engine/src/tests/toolsettings.rs index a9d9e3f5bd..55513238de 100644 --- a/crates/engine/src/tests/toolsettings.rs +++ b/crates/engine/src/tests/toolsettings.rs @@ -30,6 +30,24 @@ fn blob_tip_options_report_and_persist() { assert_eq!((next.tool_options()["angle"].as_f64(), next.tool_options()["roundness"].as_f64()), (Some(45.0), Some(0.0))); } +/// The Circle tool's From Center survives a tool switch and is saved with the preferences. +#[test] +fn circle_from_center_persists() { + let mut s = session(); + select(&mut s, "circle"); + assert_eq!(s.tool_options(), json!({"fromCenter": false})); + s.set_tool_option("fromCenter", &json!(true)); + select(&mut s, "selection"); + select(&mut s, "circle"); + assert_eq!(s.tool_options(), json!({"fromCenter": true})); + select(&mut s, "selection"); + let saved = serde_json::to_string(&s.prefs).unwrap(); + let mut next = session(); + next.apply_prefs(serde_json::from_str(&saved).unwrap()); + select(&mut next, "circle"); + assert_eq!(next.tool_options(), json!({"fromCenter": true})); +} + #[test] fn options_survive_a_tool_switch() { let mut s = session(); diff --git a/crates/engine/src/tooling.rs b/crates/engine/src/tooling.rs index 8b8cf4628b..d17caea3dd 100644 --- a/crates/engine/src/tooling.rs +++ b/crates/engine/src/tooling.rs @@ -1369,6 +1369,9 @@ impl Session { } // Every value is checked before any is set, so an invalid one changes nothing. vectorcraft_tools::builder::check_builder_options(tool.unwrap_or(self.tool.id()), &values)?; + if tool.unwrap_or(self.tool.id()) == vectorcraft_tools::circle::ID { + vectorcraft_tools::circle::check_options(&values)?; + } if tool.unwrap_or(self.tool.id()) == vectorcraft_tools::cropimage::ID { use vectorcraft_tools::cropimage as crop; // The most the selected image can be cropped to, when one is selected. diff --git a/crates/tools/src/circle.rs b/crates/tools/src/circle.rs index 76e5a2df36..96594a3391 100644 --- a/crates/tools/src/circle.rs +++ b/crates/tools/src/circle.rs @@ -15,8 +15,16 @@ //! circle passes through the points (two are the same, three lie on one line) or the circle would //! reach past the canvas, the tool shows none and the release draws nothing; for three different //! points on one line, or a circle past the canvas, the pointer shows "Circle too large". +//! +//! With the option From Center (`fromCenter`, in the Control bar) on, the first point is the +//! circle's center and the outline passes through the second: a drag from the center, or a click +//! on the center and then on a point of the outline, draws the circle whose radius is the distance +//! between them (`shape.circleThroughPoints` with `center`). The second point snaps to anchors and +//! Smart Guides as the others do, so the outline can pass exactly through another object's anchor. +//! Shift keeps the second point at 45° steps from the center, and Alt rounds the diameter to the +//! rulers' ticks. The option in force when the first point is placed applies to that circle. -use serde_json::{Value, json}; +use serde_json::{Map, Value, json}; use vectorcraft_doc::MAX_COORD; use vectorcraft_geom::{Point, Rect, Vec2, shapes}; @@ -57,35 +65,76 @@ pub struct CircleTool { press: Option, /// Where the pointer is, snapped: the point the next press or release places. pointer: Option, + /// The option From Center (`fromCenter`): the first point is the center. + from_center: bool, + /// Is the circle being drawn drawn from its center (From Center when its first point was + /// placed)? + centered: bool, } -/// The command the tool runs for `points`. -fn command(points: &[Point]) -> (String, Value) { - let pairs: Vec = points.iter().map(|p| json!([p.x, p.y])).collect(); - ("shape.circleThroughPoints".into(), json!({ "points": pairs })) +/// The command the tool runs for `points`: with `centered`, the first point is the center and +/// the second is on the outline. +fn command(points: &[Point], centered: bool) -> (String, Value) { + let pair = |p: &Point| json!([p.x, p.y]); + match points { + [c, p] if centered => ("shape.circleThroughPoints".into(), json!({ "center": pair(c), "points": [pair(p)] })), + _ => ("shape.circleThroughPoints".into(), json!({ "points": points.iter().map(pair).collect::>() })), + } +} + +/// Is the circle at `c` with radius `r` inside the canvas? +fn on_canvas(c: Point, r: f64) -> bool { + [c.x - r, c.y - r, c.x + r, c.y + r].iter().all(|v| v.abs() <= MAX_COORD) } /// The circle through two points (the ends of a diameter) or three, as `shape.circleThroughPoints` /// draws it: none where no circle passes through them or it would reach past the canvas. pub fn circle_of(points: &[Point]) -> Option<(Point, f64)> { - let on_canvas = |(c, r): &(Point, f64)| [c.x - r, c.y - r, c.x + r, c.y + r].iter().all(|v| v.abs() <= MAX_COORD); - shapes::circle_through_points(points).filter(on_canvas) + shapes::circle_through_points(points).filter(|(c, r)| on_canvas(*c, *r)) } -/// With Alt, `p` moved along the line from `first` so that their distance (the diameter) is on -/// the nearest ruler tick at the current zoom, in the General unit; `p` itself without Alt, and -/// when that rounding leaves no distance. -fn round_diameter(cx: &ToolContext, first: Point, p: Point, mods: Mods) -> Point { - let d = first.distance(p); +/// The circle `points` give: with `centered`, the circle at the first point whose outline passes +/// through the second, as `shape.circleThroughPoints` with `center` draws it (none for a second +/// point on the center or a circle past the canvas); otherwise [`circle_of`]. +fn circle_for(points: &[Point], centered: bool) -> Option<(Point, f64)> { + match *points { + [c, p] if centered => { + let r = c.distance(p); + (c.is_finite() && r.is_finite() && r > 0.0 && on_canvas(c, r)).then_some((c, r)) + } + _ if centered => None, + _ => circle_of(points), + } +} + +/// With Alt, `p` moved along the line from `first` so that the diameter (their distance, or twice +/// it from a center) is on the nearest ruler tick at the current zoom, in the General unit; `p` +/// itself without Alt, and when that rounding leaves no distance. +fn round_diameter(cx: &ToolContext, first: Point, p: Point, mods: Mods, centered: bool) -> Point { + let per = if centered { 2.0 } else { 1.0 }; + let d = first.distance(p) * per; let rounded = cx.unit.snap_to_ruler_tick(d, cx.zoom); if mods.alt && d > 0.0 && rounded > 0.0 && rounded.is_finite() { first + (p - first) * (rounded / d) } else { p } } /// Are the points two or more different points through which no circle is drawn: three on one /// line, or a circle that would reach past the canvas? -fn too_large(points: &[Point]) -> bool { +fn too_large(points: &[Point], centered: bool) -> bool { let distinct = points.iter().enumerate().all(|(i, p)| !points.iter().take(i).any(|q| q == p)); - points.len() >= 2 && distinct && circle_of(points).is_none() + points.len() >= 2 && distinct && circle_for(points, centered).is_none() +} + +/// Checks the options `tool.setOption` sets on the Circle tool: `fromCenter` is true or false, and +/// no other key is known. +pub fn check_options(values: &Map) -> Result<(), String> { + for (key, v) in values { + match key.as_str() { + "fromCenter" if v.is_boolean() => {} + "fromCenter" => return Err(format!("`{key}` must be true or false")), + _ => return Err(format!("unknown Circle tool option `{key}`")), + } + } + Ok(()) } impl CircleTool { @@ -93,9 +142,15 @@ impl CircleTool { self.first = None; self.press = None; self.pointer = None; + self.centered = false; self.snap.clear(); } + /// [`round_diameter`] for the circle being drawn. + fn round(&self, cx: &ToolContext, first: Point, p: Point, mods: Mods) -> Point { + round_diameter(cx, first, p, mods, self.centered) + } + /// How the second point keeps to the first: Shift's 45° steps and the construction guides. fn leave(&self, cx: &ToolContext, mods: Mods) -> Option { self.first.map(|a| Leave::segment(cx, a, mods.shift)) @@ -108,6 +163,8 @@ impl CircleTool { Some(Press::First { .. }) | None => out.extend(self.pointer.filter(|_| self.first.is_some())), // A press on the first point adds no point: a drag from it drags out a diameter. Some(Press::Second { on_first: true, dragged, .. }) => out.extend(self.pointer.filter(|_| dragged)), + // From a center, the second point follows the pointer. + Some(Press::Second { .. }) if self.centered => out.extend(self.pointer), Some(Press::Second { at, dragged: false, .. }) => out.push(at), Some(Press::Second { snapped, dragged: true, .. }) => { out.push(snapped); @@ -117,8 +174,12 @@ impl CircleTool { out } - /// The second point as the tool shows it: none for a press on the first point. + /// The second point as the tool shows it: none for a press on the first point, nor for a + /// circle drawn from its center, whose second point follows the pointer. fn second(&self) -> Option { + if self.centered { + return None; + } match self.press { Some(Press::Second { on_first: false, dragged: false, at, .. }) => Some(at), Some(Press::Second { on_first: false, dragged: true, snapped, .. }) => Some(snapped), @@ -129,11 +190,12 @@ impl CircleTool { /// Runs the circle through `points` and starts afresh; where no circle is drawn through them /// (the tool showed none), it only starts afresh. fn draw(&mut self, points: &[Point]) -> Vec { + let centered = self.centered; self.clear(); - if circle_of(points).is_none() { + if circle_for(points, centered).is_none() { return vec![]; } - let (c, v) = command(points); + let (c, v) = command(points, centered); vec![Action::Exec(c, v)] } } @@ -151,7 +213,7 @@ impl Tool for CircleTool { PointerKind::Move => { let leave = self.leave(cx, ev.mods); let p = self.snap.hover(cx, ev.pos, &[], leave.as_ref()); - self.pointer = Some(self.first.map_or(p, |a| round_diameter(cx, a, p, ev.mods))); + self.pointer = Some(self.first.map_or(p, |a| self.round(cx, a, p, ev.mods))); vec![] } PointerKind::Down => { @@ -159,13 +221,14 @@ impl Tool for CircleTool { None => { let at = self.snap.press(cx, ev.pos, &[], None); self.first = Some(at); + self.centered = self.from_center; self.press = Some(Press::First { at, from: ev.pos, dragged: false }); self.pointer = Some(at); } Some(a) => { let leave = self.leave(cx, ev.mods); let snapped = self.snap.press(cx, ev.pos, &[], leave.as_ref()); - let at = round_diameter(cx, a, snapped, ev.mods); + let at = self.round(cx, a, snapped, ev.mods); let on_first = snapped == a || ev.pos.distance(a) <= cx.tol(REACH_PX); self.press = Some(Press::Second { at, snapped, from: ev.pos, on_first, dragged: false }); self.pointer = Some(at); @@ -174,19 +237,21 @@ impl Tool for CircleTool { vec![] } PointerKind::Drag => { + let centered = self.centered; match &mut self.press { Some(Press::First { at, from, dragged }) => { *dragged |= ev.pos.distance(*from) >= cx.tol(DRAG_PX); let leave = Leave::segment(cx, *at, ev.mods.shift); - self.pointer = Some(round_diameter(cx, *at, self.snap.drag(cx, ev.pos, Some(&leave)), ev.mods)); + self.pointer = Some(round_diameter(cx, *at, self.snap.drag(cx, ev.pos, Some(&leave)), ev.mods, centered)); } // Dragged from the first point, the pointer is the other end of a diameter, as - // for a drag from a first press. - Some(Press::Second { from, on_first: true, dragged, .. }) => { + // for a drag from a first press; from a center, the second point is always the + // pointer. + Some(Press::Second { from, dragged, on_first, .. }) if *on_first || centered => { *dragged |= ev.pos.distance(*from) >= cx.tol(DRAG_PX); let leave = self.first.map(|a| Leave::segment(cx, a, ev.mods.shift)); let p = self.snap.drag(cx, ev.pos, leave.as_ref()); - self.pointer = Some(self.first.map_or(p, |a| round_diameter(cx, a, p, ev.mods))); + self.pointer = Some(self.first.map_or(p, |a| round_diameter(cx, a, p, ev.mods, centered))); } Some(Press::Second { from, dragged, .. }) => { *dragged |= ev.pos.distance(*from) >= cx.tol(DRAG_PX); @@ -208,6 +273,8 @@ impl Tool for CircleTool { (Some(Press::Second { on_first: true, dragged: false, .. }), ..) => vec![], (Some(Press::Second { on_first: true, dragged: true, .. }), Some(a), Some(c)) => self.draw(&[a, c]), (Some(Press::Second { at, dragged: false, .. }), Some(a), _) => self.draw(&[a, at]), + // From a center: the outline passes through the point the drag ends on. + (Some(Press::Second { dragged: true, .. }), Some(a), Some(c)) if self.centered => self.draw(&[a, c]), // Three points: Alt's rounding of the diameter does not apply. (Some(Press::Second { snapped, dragged: true, .. }), Some(a), Some(c)) => self.draw(&[a, snapped, c]), _ => vec![], @@ -216,6 +283,19 @@ impl Tool for CircleTool { } } + /// `{fromCenter}`. + fn options(&self) -> Value { + json!({ "fromCenter": self.from_center }) + } + + /// `fromCenter` (true or false, [`check_options`]); a circle being drawn keeps the mode it + /// started with. + fn set_option(&mut self, key: &str, value: &Value) { + if let ("fromCenter", Some(on)) = (key, value.as_bool()) { + self.from_center = on; + } + } + fn key(&mut self, _cx: &ToolContext, key: ToolKey, _mods: Mods) -> Vec { if key == ToolKey::Escape { self.clear(); @@ -263,13 +343,14 @@ impl Tool for CircleTool { let mut o = self.snap.guides().to_vec(); let points = self.points(); let color = crate::draw2::FEEDBACK; - if let Some((c, r)) = circle_of(&points) { + if let Some((c, r)) = circle_for(&points, self.centered) { let path = shapes::ellipse(Rect::new(c.x - r, c.y - r, c.x + r, c.y + r)).to_bezpath(); // The canvas draws a dashed outline dash by dash along its whole length: a circle longer // than DASHED_PX on screen is drawn solid instead. let dashed = std::f64::consts::TAU * r <= cx.tol(DASHED_PX); o.push(Overlay::Path { path, color, width: 1.0, dashed }); - for p in &points { + // A circle drawn from its center has one radius, to the point on its outline. + for p in points.iter().filter(|p| **p != c) { o.push(Overlay::Line { a: c, b: *p, color, dashed: false }); } let arm = cx.tol(CROSS_PX); @@ -278,7 +359,7 @@ impl Tool for CircleTool { if let Some(p) = self.pointer.filter(|_| cx.measurement_labels) { o.push(Overlay::Measure { p: p + Vec2::new(cx.tol(12.0), cx.tol(12.0)), text: format!("D: {}", cx.len(2.0 * r)) }); } - } else if let Some(p) = self.pointer.filter(|_| too_large(&points)) { + } else if let Some(p) = self.pointer.filter(|_| too_large(&points, self.centered)) { o.push(Overlay::Label { p, text: "Circle too large".into(), color }); } for p in self.first.into_iter().chain(self.second()) { diff --git a/crates/tools/src/circle/tests.rs b/crates/tools/src/circle/tests.rs index a6caafbc1d..53ae46bbef 100644 --- a/crates/tools/src/circle/tests.rs +++ b/crates/tools/src/circle/tests.rs @@ -199,8 +199,8 @@ fn points_on_one_line_say_the_circle_is_too_large() { assert_eq!(label(&t), None, "a circle is shown"); t.pointer(&cx, &ev(PointerKind::Drag, (200.0, 200.0), Mods::default())); assert_eq!(label(&t), None, "the third point is on the second"); - assert!(too_large(&[Point::new(0.0, 0.0), Point::new(4.1e6, 0.0)])); - assert!(!too_large(&[Point::new(0.0, 0.0)]) && !too_large(&[Point::new(1.0, 0.0), Point::new(1.0, 0.0)])); + assert!(too_large(&[Point::new(0.0, 0.0), Point::new(4.1e6, 0.0)], false)); + assert!(!too_large(&[Point::new(0.0, 0.0)], false) && !too_large(&[Point::new(1.0, 0.0), Point::new(1.0, 0.0)], false)); } /// Escape drops the first point; so do a dropped press and an edit made outside the tool. A @@ -313,6 +313,126 @@ fn a_huge_circle_is_previewed_solid() { assert!(preview(&t.overlays(&cx)).is_some()); } +/// The command the tool runs for a circle at `c` whose outline passes through `p`. +fn centered(c: (f64, f64), p: (f64, f64)) -> Vec { + vec![Action::Exec("shape.circleThroughPoints".into(), json!({ "center": [c.0, c.1], "points": [[p.0, p.1]] }))] +} + +fn from_center() -> CircleTool { + let mut t = CircleTool::default(); + t.set_option("fromCenter", &json!(true)); + t +} + +/// With From Center, a drag from the corner anchor of the rectangle at (200, 200) to next to the +/// opposite corner at (100, 100) snaps both ends to the anchors: the circle is centered on one +/// corner, its outline passes through the other, and its radius is the diagonal. Until the release +/// the outline passes through the pointer, with one radius drawn to it. +#[test] +fn from_center_the_outline_passes_through_the_opposite_corner() { + let (d, _) = doc_with_rect(); + let (s, p) = (Selection::default(), paint()); + let cx = cx(&d, &s, &p); + let mut t = from_center(); + assert_eq!(t.options(), json!({ "fromCenter": true })); + t.pointer(&cx, &ev(PointerKind::Move, (201.0, 199.5), Mods::default())); + t.pointer(&cx, &ev(PointerKind::Down, (201.0, 199.5), Mods::default())); + t.pointer(&cx, &ev(PointerKind::Drag, (150.0, 150.0), Mods::default())); + t.pointer(&cx, &ev(PointerKind::Drag, (101.0, 101.5), Mods::default())); + let r = 100.0 * std::f64::consts::SQRT_2; + let o = t.overlays(&cx); + let shown = o + .iter() + .find_map(|o| match o { + Overlay::Path { path, .. } => Some(vectorcraft_geom::Shape::bounding_box(path)), + _ => None, + }) + .expect("the circle is shown"); + assert!(near(shown, Rect::new(200.0 - r, 200.0 - r, 200.0 + r, 200.0 + r)), "{o:?}"); + let center = Point::new(200.0, 200.0); + let radii: Vec = o + .iter() + .filter_map(|o| match o { + Overlay::Line { a, b, .. } if *a == center => Some(*b), + _ => None, + }) + .collect(); + assert_eq!(radii, vec![Point::new(100.0, 100.0)], "one radius, to the pointer: {o:?}"); + assert!(o.iter().any(|o| matches!(o, Overlay::Measure { text, .. } if text.starts_with("D: 282.84"))), "{o:?}"); + assert_eq!(t.pointer(&cx, &ev(PointerKind::Up, (101.0, 101.5), Mods::default())), centered((200.0, 200.0), (100.0, 100.0))); + assert_eq!(circle_for(&[center, Point::new(100.0, 100.0)], true), Some((center, r))); +} + +/// With From Center, a click places the center and a second click the point the outline passes +/// through; a second click on the center places nothing, and the center stays. +#[test] +fn from_center_two_clicks_draw_the_circle_through_the_second() { + let (d, _) = doc_with_rect(); + let (s, p) = (Selection::default(), paint()); + let cx = ToolContext { smart_guides: false, ..cx(&d, &s, &p) }; + let mut t = from_center(); + assert_eq!(click(&mut t, &cx, (300.0, 300.0)), vec![]); + assert_eq!(click(&mut t, &cx, (300.5, 300.0)), vec![], "a double-click places the center alone"); + assert!(t.ends_on_escape(&cx)); + t.pointer(&cx, &ev(PointerKind::Move, (330.0, 340.0), Mods::default())); + // Center (300, 300), radius 50. + assert!(near(preview(&t.overlays(&cx)).expect("the circle is shown"), Rect::new(250.0, 250.0, 350.0, 350.0)), "{:?}", t.overlays(&cx)); + assert_eq!(click(&mut t, &cx, (330.0, 340.0)), centered((300.0, 300.0), (330.0, 340.0))); + // A second press dragged from elsewhere moves the point the outline passes through. + click(&mut t, &cx, (300.0, 300.0)); + assert_eq!(drag(&mut t, &cx, (330.0, 340.0), &[(360.0, 300.0)], Mods::default()), centered((300.0, 300.0), (360.0, 300.0))); +} + +/// With From Center, Shift keeps the point at 45° steps from the center, and Alt rounds the +/// diameter, twice the radius, to the rulers' ticks (every 5 pt at 100% in points). +#[test] +fn from_center_shift_and_alt_keep_to_the_center() { + let (d, _) = doc_with_rect(); + let (s, p) = (Selection::default(), paint()); + let cx = ToolContext { smart_guides: false, ..cx(&d, &s, &p) }; + let mut t = from_center(); + let shift = Mods { shift: true, ..Mods::default() }; + let acts = drag(&mut t, &cx, (300.0, 300.0), &[(400.0, 310.0)], shift); + let [Action::Exec(_, v)] = acts.as_slice() else { panic!("one circle: {acts:?}") }; + assert!((v["points"][0][1].as_f64().unwrap() - 300.0).abs() < 1e-9, "level with the center: {v}"); + // Near the diagonal, the point keeps to the 45° line through the center. + let acts = drag(&mut t, &cx, (300.0, 300.0), &[(380.0, 372.0)], shift); + let [Action::Exec(_, v)] = acts.as_slice() else { panic!("one circle: {acts:?}") }; + let (x, y) = (v["points"][0][0].as_f64().unwrap(), v["points"][0][1].as_f64().unwrap()); + assert!(((x - 300.0) - (y - 300.0)).abs() < 1e-9 && x > 300.0, "on the 45° line from the center: {v}"); + let alt = Mods { alt: true, ..Mods::default() }; + // A radius of 26 is a diameter of 52, which Alt makes 50. + assert_eq!(drag(&mut t, &cx, (0.0, 0.0), &[(0.0, 26.0)], alt), centered((0.0, 0.0), (0.0, 25.0))); +} + +/// The option in force when the first point is placed applies to that circle: turning From Center +/// off part way keeps the circle being drawn centered, and the next circle is drawn on a diameter. +/// A point on the center draws nothing. +#[test] +fn from_center_holds_for_the_circle_being_drawn() { + let (d, _) = doc_with_rect(); + let (s, p) = (Selection::default(), paint()); + let cx = ToolContext { smart_guides: false, ..cx(&d, &s, &p) }; + let mut t = from_center(); + click(&mut t, &cx, (100.0, 100.0)); + t.set_option("fromCenter", &json!(false)); + assert_eq!(click(&mut t, &cx, (100.0, 150.0)), centered((100.0, 100.0), (100.0, 150.0))); + assert_eq!(drag(&mut t, &cx, (300.0, 300.0), &[(380.0, 360.0)], Mods::default()), circle(&[(300.0, 300.0), (380.0, 360.0)])); + assert_eq!(circle_for(&[Point::new(1.0, 1.0), Point::new(1.0, 1.0)], true), None); + assert!(too_large(&[Point::new(0.0, 0.0), Point::new(4.1e6, 0.0)], true)); + t.set_option("fromCenter", &json!("yes")); + assert_eq!(t.options(), json!({ "fromCenter": false }), "a value that is not true or false is ignored"); +} + +/// `tool.setOption` takes `fromCenter` as true or false, and no other key. +#[test] +fn the_options_are_checked() { + let map = |v: Value| v.as_object().cloned().unwrap(); + assert_eq!(check_options(&map(json!({ "fromCenter": true }))), Ok(())); + assert_eq!(check_options(&map(json!({ "fromCenter": 1 }))), Err("`fromCenter` must be true or false".into())); + assert_eq!(check_options(&map(json!({ "radius": 5 }))), Err("unknown Circle tool option `radius`".into())); +} + /// The tool is in the Ellipse tool's group, after the Ellipse tool. #[test] fn the_circle_tool_follows_the_ellipse_tool() { diff --git a/crates/tools/src/settings.rs b/crates/tools/src/settings.rs index 97e980e3c0..65144f78b5 100644 --- a/crates/tools/src/settings.rs +++ b/crates/tools/src/settings.rs @@ -53,6 +53,8 @@ const ROWS: &[Row] = &[ (&["star"], None, &["points"]), // The Ellipse dialog's Anchors. (&["ellipse"], None, &["anchors"]), + // The Circle tool's From Center. + (&[crate::circle::ID], None, &["fromCenter"]), (&["freeTransform"], None, &["constrain"]), // Shape Builder Tool Options (`builder::ShapeBuilderOptions`). ( diff --git a/crates/ui-egui/src/chrome/tests.rs b/crates/ui-egui/src/chrome/tests.rs index 61c67e6a70..a2b240d086 100644 --- a/crates/ui-egui/src/chrome/tests.rs +++ b/crates/ui-egui/src/chrome/tests.rs @@ -3767,6 +3767,27 @@ fn control_bar_overflow(app: &mut crate::VectorcraftApp, ctx: &egui::Context, sc /// tool's, in English and in German. Every control it shows is drawn whole, left of the panel menu /// button, which shows in every width, with the bar docked to the top or the bottom or floating. In a /// wide window, each of those groups shows its controls. +/// A click on the Circle tool's From Center checkbox in the Control bar turns the option on, and a +/// second click turns it off. +#[test] +fn the_circle_tool_s_from_center_checkbox_sets_the_option() { + use crate::tests_removeanchors::{click_control, control_frame}; + crate::i18n::set_current(crate::i18n::Lang::EN); + let mut app = crate::VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 400, "height": 200})).unwrap(); + app.select_tool("circle"); + let ctx = egui::Context::default(); + crate::theme::install_fonts(&ctx); + let from_center = |app: &crate::VectorcraftApp| app.session.tool_options()["fromCenter"].clone(); + assert_eq!(from_center(&app), json!(false)); + for want in [true, false] { + let bar = control_frame(&mut app, &ctx, vec![]); + let at = bar.iter().find(|(t, _)| t == "From Center").map(|(_, r)| r.center()).expect("From Center shows"); + click_control(&mut app, &ctx, at); + assert_eq!(from_center(&app), json!(want)); + } +} + #[test] fn the_control_bar_s_controls_stay_inside_the_bar_in_a_narrow_window() { use crate::tests_removeanchors::{control_frame, has}; @@ -3820,10 +3841,12 @@ fn the_control_bar_s_controls_stay_inside_the_bar_in_a_narrow_window() { }; // The tools' options, with a rectangle selected and with nothing selected. app.run("select.set", json!({ "ids": [id] })).unwrap(); - for tool in ["rectangle", "ellipse", "polygon", "star", "spiral", "box3d", "dimension", "mirrorCut", "puppetWarp"] { + for tool in ["rectangle", "ellipse", "circle", "polygon", "star", "spiral", "box3d", "dimension", "mirrorCut", "puppetWarp"] { app.select_tool(tool); check(&mut app, tool); } + app.select_tool("circle"); + wide(&mut app, "Circle", &["From Center"]); app.select_tool("polygon"); wide(&mut app, "Polygon", &["Round", "Random", "Reset"]); app.select_tool("mirrorCut"); diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index d347439b69..0344f9e24c 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -467,6 +467,7 @@ font-technology Variable Променливи Circle Кръг Circle Tool Инструмент Кръг Circle too large Кръгът е твърде голям + From Center От центъра Classic Defaults Класически по подразбиране Clean Up… Почистване… Clear Изчистване diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 6fea288f77..86d6495de6 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -4527,6 +4527,7 @@ font-technology Variable Varijabilni Circle Krug Circle Tool Alat za krug Circle too large Krug je prevelik + From Center Od središta Clip to Art Isijeci prema crtežu Colorize Oboji Gamma Gama diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index e99406bffe..fd363e5cc6 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -702,6 +702,7 @@ antiAlias Sharp Nítid Circle Cercle Circle Tool Eina de cercle Circle too large El cercle és massa gran + From Center Des del centre Circle (open) Cercle (obert) Classic Clàssic Classic Defaults Valors predeterminats clàssics @@ -5584,6 +5585,7 @@ digits Malayalam Malaiàlam @msg `{key}` must be a #rrggbb color or a layer color name `{key}` ha de ser un color #rrggbb o el nom d’un color de capa @msg unknown Live Paint option `{key}` opció de pintura interactiva desconeguda `{key}` @msg unknown Shape Builder option `{key}` opció del constructor de formes desconeguda `{key}` +@msg unknown Circle tool option `{key}` opció de l’eina Cercle desconeguda `{key}` @msg `{key}` must be a #rrggbb colour `{key}` ha de ser un color #rrggbb @msg `{key}` must be a number `{key}` ha de ser un nombre @msg `{key}` must be a number not below 0 `{key}` ha de ser un nombre no inferior a 0 @@ -6152,6 +6154,8 @@ liquify-list-end {0}, {1} {0} i {1} @msg no active perspective plane no hi ha cap pla de perspectiva actiu @msg no anchor points selected no hi ha cap punt d’ancoratge seleccionat @msg `points` must be two or three [x, y] pairs of numbers `points` han de ser dos o tres parells de nombres [x, y] +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` ha de ser un parell de nombres [x, y], amb un parell [x, y] a `points` +@msg the point in `points` is on `center` el punt de `points` és a `center` @msg direct-select two or three anchor points, or give `points` seleccioneu directament dos o tres punts d’ancoratge o indiqueu `points` @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 no app to open files here aquí no hi ha cap aplicació per obrir fitxers diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index b217199fe0..662911c598 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -4631,6 +4631,7 @@ font-technology Variable Variabilní Circle Kruh Circle Tool Nástroj Kruh Circle too large Kruh je příliš velký + From Center Ze středu Clip to Art Oříznout podle kresby Colorize Obarvit Gamma Gama @@ -5121,6 +5122,7 @@ liquify-list-end {0}, {1} {0} a {1} @msg `{key}` must be a #rrggbb color or a layer color name `{key}` musí být barva #rrggbb nebo název barvy vrstvy @msg unknown Live Paint option `{key}` neznámá možnost živé malby `{key}` @msg unknown Shape Builder option `{key}` neznámá možnost tvorby tvarů `{key}` +@msg unknown Circle tool option `{key}` neznámá možnost nástroje Kruh `{key}` @msg `{key}` must be a #rrggbb colour `{key}` musí být barva #rrggbb @msg `{key}` must be a number `{key}` musí být číslo @msg `{key}` must be a number, not {v} `{key}` musí být číslo, ne {v} @@ -5317,6 +5319,8 @@ liquify-list-end {0}, {1} {0} a {1} @msg no active perspective plane žádná aktivní perspektivní rovina @msg no anchor points selected nejsou vybrány žádné kotevní body @msg `points` must be two or three [x, y] pairs of numbers `points` musí být dvě nebo tři dvojice čísel [x, y] +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` musí být dvojice čísel [x, y] a `points` musí obsahovat jednu dvojici [x, y] +@msg the point in `points` is on `center` bod v `points` leží na `center` @msg direct-select two or three anchor points, or give `points` vyberte přímým výběrem dva nebo tři kotevní body, nebo zadejte `points` @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 no app to open files here zde chybí aplikace pro otevírání souborů diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index de726e7860..e62fe02e03 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -229,6 +229,7 @@ liquify-list-end {0}, {1} {0} og {1} @msg `{key}` must be a #rrggbb color or a layer color name `{key}` skal være en #rrggbb-farve eller navnet på en lagfarve @msg unknown Live Paint option `{key}` ukendt Live Paint-indstilling `{key}` @msg unknown Shape Builder option `{key}` ukendt Formbygger-indstilling `{key}` +@msg unknown Circle tool option `{key}` ukendt Cirkelværktøj-indstilling `{key}` @msg `{key}` must be a profile name or null `{key}` skal være et profilnavn eller null @msg `top` and `below` can't both be true `top` og `below` kan ikke begge være true @msg `select` must be true or false `select` skal være true eller false @@ -7030,6 +7031,7 @@ font-technology Variable Variable Circle Cirkel Circle Tool Cirkelværktøj Circle too large Cirklen er for stor + From Center Fra midten Clip to Art Beskær til grafik Colorize Farvelæg Gamma Gamma @@ -7506,6 +7508,8 @@ imageTrace Outline Kontur @msg no active perspective plane intet aktivt perspektivplan @msg no anchor points selected ingen ankerpunkter er markeret @msg `points` must be two or three [x, y] pairs of numbers `points` skal være to eller tre talpar [x, y] +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` skal være et talpar [x, y], med ét talpar [x, y] i `points` +@msg the point in `points` is on `center` punktet i `points` ligger på `center` @msg direct-select two or three anchor points, or give `points` direkte markér to eller tre ankerpunkter, eller angiv `points` @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 no app to open files here ingen app til at åbne filer her diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index f85240675f..51859ea3bc 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -458,6 +458,7 @@ font-technology Variable Variabel Circle Kreis Circle Tool Kreis-Werkzeug Circle too large Kreis zu groß + From Center Von der Mitte aus Classic Defaults Klassische Standardwerte Clean Up… Aufräumen… Clear Löschen @@ -4722,6 +4723,7 @@ liquify-list-end {0}, {1} {0} und {1} @msg `{key}` must be a #rrggbb color or a layer color name `{key}` muss eine Farbe der Form #rrggbb oder der Name einer Ebenenfarbe sein @msg unknown Live Paint option `{key}` unbekannte Option für Interaktiv malen `{key}` @msg unknown Shape Builder option `{key}` unbekannte Option für Formerstellung `{key}` +@msg unknown Circle tool option `{key}` unbekannte Option für das Kreis-Werkzeug `{key}` @msg `{key}` must be a #rrggbb colour `{key}` muss eine Farbe der Form #rrggbb sein @msg `{key}` must be a number `{key}` muss eine Zahl sein @msg `{key}` must be a number, not {v} `{key}` muss eine Zahl sein, nicht {v} @@ -4918,6 +4920,8 @@ liquify-list-end {0}, {1} {0} und {1} @msg no active perspective plane keine aktive Perspektivebene @msg no anchor points selected keine Ankerpunkte ausgewählt @msg `points` must be two or three [x, y] pairs of numbers `points` muss aus zwei oder drei Zahlenpaaren [x, y] bestehen +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` muss ein Zahlenpaar [x, y] sein, mit einem Paar [x, y] in `points` +@msg the point in `points` is on `center` der Punkt in `points` liegt auf `center` @msg direct-select two or three anchor points, or give `points` wählen Sie zwei oder drei Ankerpunkte direkt aus oder geben Sie `points` an @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 no app to open files here hier gibt es keine App zum Öffnen von Dateien diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index a26550a5ac..31699d5491 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -451,6 +451,7 @@ font-technology Variable Μεταβλητές Circle Κύκλος Circle Tool Εργαλείο κύκλου Circle too large Ο κύκλος είναι πολύ μεγάλος + From Center Από το κέντρο Classic Defaults Κλασικές προεπιλογές Clean Up… Εκκαθάριση… Clear Εκκαθάριση @@ -2721,6 +2722,7 @@ liquify-list-end {0}, {1} {0} και {1} @msg `{key}` must be a #rrggbb color or a layer color name Το `{key}` πρέπει να είναι χρώμα #rrggbb ή όνομα χρώματος επιπέδου @msg unknown Live Paint option `{key}` άγνωστη επιλογή δυναμικής βαφής `{key}` @msg unknown Shape Builder option `{key}` άγνωστη επιλογή δημιουργίας σχημάτων `{key}` +@msg unknown Circle tool option `{key}` άγνωστη επιλογή εργαλείου κύκλου `{key}` @msg `{key}` must be a #rrggbb colour Το `{key}` πρέπει να είναι χρώμα #rrggbb @msg `{key}` must be a number Το `{key}` πρέπει να είναι αριθμός @msg `{key}` must be a number, not {v} Το `{key}` πρέπει να είναι αριθμός, όχι {v} @@ -4976,6 +4978,8 @@ digits Malayalam Μαλαγιάλαμ @msg no active perspective plane δεν υπάρχει ενεργό επίπεδο προοπτικής @msg no anchor points selected δεν έχουν επιλεγεί σημεία αγκύρωσης @msg `points` must be two or three [x, y] pairs of numbers το `points` πρέπει να είναι δύο ή τρία ζεύγη αριθμών [x, y] +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` το `center` πρέπει να είναι ένα ζεύγος αριθμών [x, y], με ένα ζεύγος [x, y] στο `points` +@msg the point in `points` is on `center` το σημείο στο `points` βρίσκεται πάνω στο `center` @msg direct-select two or three anchor points, or give `points` επιλέξτε άμεσα δύο ή τρία σημεία αγκύρωσης ή δώστε `points` @msg no circle passes through these points: two are the same or all three lie on one line κανένας κύκλος δεν περνά από αυτά τα σημεία: δύο είναι ίδια ή και τα τρία βρίσκονται σε μία ευθεία @msg no app to open files here δεν υπάρχει εφαρμογή για άνοιγμα αρχείων εδώ diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 74e4627a9c..5901422d6b 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -481,6 +481,7 @@ font-technology Variable Variables Circle Círculo Circle Tool Herramienta Círculo Circle too large Círculo demasiado grande + From Center Desde el centro Classic Defaults Valores predeterminados clásicos Clean Up… Limpiar… Clear Borrar @@ -4826,6 +4827,7 @@ liquify-list-end {0}, {1} {0}, {1} @msg `{key}` must be a #rrggbb color or a layer color name `{key}` debe ser un color #rrggbb o el nombre de un color de capa @msg unknown Live Paint option `{key}` opción de pintura interactiva desconocida `{key}` @msg unknown Shape Builder option `{key}` opción del generador de formas desconocida `{key}` +@msg unknown Circle tool option `{key}` opción de la herramienta Círculo desconocida `{key}` @msg `{key}` must be a #rrggbb colour `{key}` debe ser un color #rrggbb @msg `{key}` must be a number `{key}` debe ser un número @msg `{key}` must be a number, not {v} `{key}` debe ser un número, no {v} @@ -5022,6 +5024,8 @@ liquify-list-end {0}, {1} {0}, {1} @msg no active perspective plane no hay ningún plano de perspectiva activo @msg no anchor points selected no hay puntos de ancla seleccionados @msg `points` must be two or three [x, y] pairs of numbers `points` debe ser dos o tres pares de números [x, y] +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` debe ser un par de números [x, y], con un par [x, y] en `points` +@msg the point in `points` is on `center` el punto de `points` está en `center` @msg direct-select two or three anchor points, or give `points` seleccione directamente dos o tres puntos de ancla o indique `points` @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 no app to open files here aquí no hay ninguna aplicación para abrir archivos diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 170db8da57..a3d6f76b86 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -4550,6 +4550,7 @@ font-technology Variable Muuttuvat Circle Ympyrä Circle Tool Ympyrätyökalu Circle too large Ympyrä on liian suuri + From Center Keskeltä Clip to Art Rajaa kuvitukseen Colorize Väritä Gamma Gamma @@ -5058,6 +5059,7 @@ liquify-list-end {0}, {1} {0} ja {1} @msg `{key}` must be a #rrggbb color or a layer color name `{key}` on oltava #rrggbb-väri tai tason värin nimi @msg unknown Live Paint option `{key}` tuntematon elävän maalauksen valinta `{key}` @msg unknown Shape Builder option `{key}` tuntematon muodonmuodostimen valinta `{key}` +@msg unknown Circle tool option `{key}` tuntematon ympyrätyökalun valinta `{key}` @msg `{key}` must be a #rrggbb colour `{key}` on oltava #rrggbb-väri @msg `{key}` must be a number `{key}` on oltava luku @msg `{key}` must be a number, not {v} `{key}` on oltava luku, ei {v} @@ -5246,6 +5248,8 @@ liquify-list-end {0}, {1} {0} ja {1} @msg no active perspective plane ei aktiivista perspektiivitasoa @msg no anchor points selected ankkuripisteitä ei ole valittu @msg `points` must be two or three [x, y] pairs of numbers `points` on annettava kahtena tai kolmena lukuparina [x, y] +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` on annettava lukuparina [x, y], ja `points` sisältää yhden lukuparin [x, y] +@msg the point in `points` is on `center` `points`-kohdan piste on `center`-kohdassa @msg direct-select two or three anchor points, or give `points` valitse suoraan kaksi tai kolme ankkuripistettä tai anna `points` @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 no app to open files here täällä ei ole sovellusta tiedostojen avaamiseen diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 9ca4919a2e..1080917f44 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -482,6 +482,7 @@ font-technology Variable Variables Circle Cercle Circle Tool Outil Cercle Circle too large Cercle trop grand + From Center Depuis le centre Classic Defaults Valeurs par défaut classiques Clean Up… Nettoyer… Clear Effacer @@ -4788,6 +4789,7 @@ liquify-list-end {0}, {1} {0} et {1} @msg `{key}` must be a #rrggbb color or a layer color name `{key}` doit être une couleur #rrggbb ou le nom d’une couleur de calque @msg unknown Live Paint option `{key}` option de peinture dynamique inconnue `{key}` @msg unknown Shape Builder option `{key}` option du concepteur de forme inconnue `{key}` +@msg unknown Circle tool option `{key}` option de l’outil Cercle inconnue `{key}` @msg `{key}` must be a #rrggbb colour `{key}` doit être une couleur #rrggbb @msg `{key}` must be a number `{key}` doit être un nombre @msg `{key}` must be a number, not {v} `{key}` doit être un nombre, pas {v} @@ -4984,6 +4986,8 @@ liquify-list-end {0}, {1} {0} et {1} @msg no active perspective plane aucun plan de perspective actif @msg no anchor points selected aucun point d’ancrage sélectionné @msg `points` must be two or three [x, y] pairs of numbers `points` doit contenir deux ou trois paires de nombres [x, y] +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` doit être une paire de nombres [x, y], avec une paire [x, y] dans `points` +@msg the point in `points` is on `center` le point de `points` est sur `center` @msg direct-select two or three anchor points, or give `points` sélectionnez deux ou trois points d’ancrage avec l’outil Sélection directe, ou indiquez `points` @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 no app to open files here aucune application pour ouvrir des fichiers ici diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 532fcb06cb..2f0554abb7 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -564,6 +564,7 @@ Circle વર્તુળ Circle Tool વર્તુળ ટૂલ Circle too large વર્તુળ ખૂબ મોટું છે + From Center કેન્દ્રથી Circle: વર્તુળ: Classic ક્લાસિક Clean Up સાફ કરો diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 3bfe38fb3e..747f8f82cf 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -822,6 +822,7 @@ antiAlias Sharp शार्प Circle वृत्त Circle Tool वृत्त टूल Circle too large वृत्त बहुत बड़ा है + From Center केंद्र से Circle (open) सर्किल (ओपन) Circle: वृत्त: Classic क्लासिक @@ -6245,6 +6246,7 @@ antiAlias Sharp शार्प @msg `{key}` must be a #rrggbb color or a layer color name `{key}` एक #rrggbb रंग या लेयर रंग का नाम होना चाहिए @msg unknown Live Paint option `{key}` अज्ञात लाइव पेंट ऑप्शन `{key}` @msg unknown Shape Builder option `{key}` अज्ञात शेप बिल्डर ऑप्शन `{key}` +@msg unknown Circle tool option `{key}` अज्ञात वृत्त टूल ऑप्शन `{key}` @msg `{key}` must be a #rrggbb colour `{key}` एक #rrggbb रंग होना चाहिए @msg `{key}` must be a non-negative integer `{key}` को एक गैर-नकारात्मक पूर्णांक होना चाहिए @msg `{key}` must be a number `{key}` एक संख्या होना चाहिए @@ -7634,6 +7636,8 @@ liquify-list-end {0}, {1} {0} और {1} @msg no active perspective plane कोई सक्रिय पर्सपेक्टिव विमान नहीं @msg no anchor points selected कोई एंकर पॉइंट सिलेक्ट नहीं है @msg `points` must be two or three [x, y] pairs of numbers `points` में संख्याओं के दो या तीन [x, y] जोड़े होने चाहिए +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` संख्याओं का एक [x, y] जोड़ा होना चाहिए, और `points` में एक [x, y] जोड़ा होना चाहिए +@msg the point in `points` is on `center` `points` का बिंदु `center` पर है @msg direct-select two or three anchor points, or give `points` दो या तीन एंकर पॉइंट्स डायरेक्ट-सिलेक्ट करें, या `points` दें @msg no circle passes through these points: two are the same or all three lie on one line इन पॉइंट्स से होकर कोई वृत्त नहीं गुज़रता: दो एक जैसे हैं या तीनों एक ही रेखा पर हैं @msg no app to open files here यहां फ़ाइलों को ओपन करने के लिए कोई ऐप नहीं है diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index cfc6c224a3..5c4977da98 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -643,6 +643,7 @@ font-technology Variable Változó Circle Kör Circle Tool Kör eszköz Circle too large A kör túl nagy + From Center Középről Circle (open) Kör (nyitott) Classic Defaults Klasszikus alapértékek Clean Up… Tisztítás… @@ -5182,6 +5183,7 @@ imageTrace Outline Körvonal @msg `{key}` must be a #rrggbb color or a layer color name `{key}`: #rrggbb szín vagy rétegszín neve kell @msg unknown Live Paint option `{key}` ismeretlen élő festés beállítás: `{key}` @msg unknown Shape Builder option `{key}` ismeretlen alakzatépítő beállítás: `{key}` +@msg unknown Circle tool option `{key}` ismeretlen Kör eszköz beállítás: `{key}` @msg `{key}` must be a #rrggbb colour `{key}`: #rrggbb szín kell @msg `{key}` must be a number `{key}`: szám kell @msg `{key}` must be a number, not {v} `{key}`: szám kell, ez nem az: {v} @@ -5685,6 +5687,8 @@ liquify-list-end {0}, {1} {0} és {1} @msg no active perspective plane nincs aktív perspektivikus sík @msg no anchor points selected nincs kijelölt horgonypont @msg `points` must be two or three [x, y] pairs of numbers a `points` két vagy három [x, y] számpár legyen +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` a `center` egy [x, y] számpár legyen, a `points` pedig egy [x, y] párt tartalmazzon +@msg the point in `points` is on `center` a `points` pontja a `center` helyén van @msg direct-select two or three anchor points, or give `points` jelölj ki közvetlen kijelöléssel két vagy három horgonypontot, vagy add meg a `points` értéket @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 no app to open files here itt nincs fájlmegnyitó alkalmazás diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 0526f18380..b77f342253 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -4282,6 +4282,7 @@ font-technology Variable Variabel Circle Lingkaran Circle Tool Alat lingkaran Circle too large Lingkaran terlalu besar + From Center Dari tengah Clip to Art Pangkas ke karya seni Colorize Warnai Gamma Gamma diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 066a4ef6fd..d4d13bb83b 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -483,6 +483,7 @@ font-technology Variable Variabili Circle Cerchio Circle Tool Strumento Cerchio Circle too large Cerchio troppo grande + From Center Dal centro Classic Defaults Valori predefiniti classici Clean Up… Pulisci… Clear Cancella @@ -4856,6 +4857,7 @@ liquify-list-end {0}, {1} {0} e {1} @msg `{key}` must be a #rrggbb color or a layer color name `{key}` deve essere un colore #rrggbb o il nome di un colore del livello @msg unknown Live Paint option `{key}` opzione di pittura dinamica sconosciuta `{key}` @msg unknown Shape Builder option `{key}` opzione del generatore forme sconosciuta `{key}` +@msg unknown Circle tool option `{key}` opzione dello strumento Cerchio sconosciuta `{key}` @msg `{key}` must be a #rrggbb colour `{key}` deve essere un colore #rrggbb @msg `{key}` must be a number `{key}` deve essere un numero @msg `{key}` must be a number, not {v} `{key}` deve essere un numero, non {v} @@ -5052,6 +5054,8 @@ liquify-list-end {0}, {1} {0} e {1} @msg no active perspective plane nessun piano prospettico attivo @msg no anchor points selected nessun punto di ancoraggio selezionato @msg `points` must be two or three [x, y] pairs of numbers `points` deve essere composto da due o tre coppie di numeri [x, y] +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` deve essere una coppia di numeri [x, y], con una coppia [x, y] in `points` +@msg the point in `points` is on `center` il punto in `points` si trova su `center` @msg direct-select two or three anchor points, or give `points` seleziona con Selezione diretta due o tre punti di ancoraggio oppure indica `points` @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 no app to open files here nessuna app per aprire file qui diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 597abda551..365eceb39f 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -1299,6 +1299,7 @@ antiAlias Sharp シャープ Circle 円 Circle Tool 円ツール Circle too large 円が大きすぎます + From Center 中心から Clear All Tabs すべてのタブを消去 Above Text テキストの上 Position Panel Above Text テキストの上にパネルを配置 @@ -4846,6 +4847,8 @@ swatch Bright Violet ビビッドバイオレット @msg clipboard is empty クリップボードが空です @msg no anchor points selected アンカーポイントが選択されていません @msg `points` must be two or three [x, y] pairs of numbers `points` は 2 組または 3 組の数値 [x, y] にしてください +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` は数値の組 [x, y] にし、`points` には [x, y] を 1 組指定してください +@msg the point in `points` is on `center` `points` の点が `center` と同じ位置にあります @msg direct-select two or three anchor points, or give `points` アンカーポイントを 2 つまたは 3 つダイレクト選択するか、`points` を指定してください @msg no circle passes through these points: two are the same or all three lie on one line これらの点を通る円はありません: 2 つの点が同じか、3 点すべてが一直線上にあります @msg select at least two objects オブジェクトを 2 つ以上選択してください @@ -4910,6 +4913,7 @@ swatch Bright Violet ビビッドバイオレット @msg `{key}` must be a #rrggbb color or a layer color name `{key}` は #rrggbb 形式のカラーかレイヤーカラー名にしてください @msg unknown Live Paint option `{key}` 不明なライブペイントオプション `{key}` @msg unknown Shape Builder option `{key}` 不明なシェイプ形成ツールオプション `{key}` +@msg unknown Circle tool option `{key}` 不明な円ツールオプション `{key}` @msg `{key}` must be a #rrggbb colour `{key}` は #rrggbb 形式のカラーにしてください @msg `{key}` must be a string `{key}` は文字列にしてください @msg `{key}` must be a profile name or null `{key}` はプロファイル名または null にしてください diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 0eb74ca1c0..67d8e1f880 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -6348,6 +6348,7 @@ font-technology Variable ცვლადი Circle წრე Circle Tool წრის ხელსაწყო Circle too large წრე ზედმეტად დიდია + From Center ცენტრიდან Clip to Art ნახატზე მოჭრა Colorize გაფერადება Gamma გამა @@ -6831,6 +6832,8 @@ font-technology Variable ცვლადი @msg no active perspective plane აქტიური პერსპექტივის სიბრტყე არ არის @msg no anchor points selected საყრდენი წერტილები მონიშნული არ არის @msg `points` must be two or three [x, y] pairs of numbers `points` უნდა იყოს რიცხვების ორი ან სამი [x, y] წყვილი +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` უნდა იყოს რიცხვების [x, y] წყვილი, ხოლო `points` უნდა შეიცავდეს ერთ [x, y] წყვილს +@msg the point in `points` is on `center` `points`-ის წერტილი `center`-ზეა @msg direct-select two or three anchor points, or give `points` პირდაპირი მონიშვნით მონიშნეთ ორი ან სამი საყრდენი წერტილი ან მიუთითეთ `points` @msg no circle passes through these points: two are the same or all three lie on one line ამ წერტილებზე წრეწირი არ გადის: ორი ერთნაირია ან სამივე ერთ წრფეზე მდებარეობს @msg no app to open files here აქ ფაილების გასახსნელი აპი არ არის @@ -8706,6 +8709,7 @@ liquify-list-end {0}, {1} {0} და {1} @msg `{key}` must be a #rrggbb color or a layer color name `{key}` უნდა იყოს #rrggbb ფერი ან ფენის ფერის სახელი @msg unknown Live Paint option `{key}` ცოცხალი შეღებვის უცნობი პარამეტრი `{key}` @msg unknown Shape Builder option `{key}` ფიგურების კონსტრუქტორის უცნობი პარამეტრი `{key}` +@msg unknown Circle tool option `{key}` წრის ხელსაწყოს უცნობი პარამეტრი `{key}` @msg a key object sits on that point ამ წერტილზე საკვანძო ობიექტი მდებარეობს @msg a linked image can't become a gradient mesh: embed it first დაკავშირებული გამოსახულება გრადიენტულ ბადედ ვერ გადაიქცევა: ჯერ ჩააშენეთ ის @msg a mask has more than one art block ნიღაბს ერთზე მეტი ნახატის ბლოკი აქვს diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 83219f8de8..e2d4dc5f97 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -1289,6 +1289,7 @@ antiAlias Sharp 날카롭게 Circle 원 Circle Tool 점 기준 원 도구 Circle too large 원이 너무 큽니다 + From Center 중심에서 Clear All Tabs 모든 탭 지우기 Above Text 문자 위 Position Panel Above Text 패널을 문자 위에 배치 @@ -4773,6 +4774,8 @@ theme Appearance 외관 @msg clipboard is empty 클립보드가 비어 있습니다 @msg no anchor points selected 선택한 앵커 포인트가 없습니다 @msg `points` must be two or three [x, y] pairs of numbers `points`는 숫자 쌍 [x, y] 두 개 또는 세 개여야 합니다 +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center`는 숫자 쌍 [x, y]이고 `points`에는 [x, y] 쌍이 하나 있어야 합니다 +@msg the point in `points` is on `center` `points`의 점이 `center`에 있습니다 @msg direct-select two or three anchor points, or give `points` 앵커 포인트 두 개 또는 세 개를 직접 선택하거나 `points`를 지정하세요 @msg no circle passes through these points: two are the same or all three lie on one line 이 점들을 지나는 원이 없습니다: 두 점이 같거나 세 점이 모두 한 직선 위에 있습니다 @msg select at least two objects 개체를 두 개 이상 선택하세요 @@ -4837,6 +4840,7 @@ theme Appearance 외관 @msg `{key}` must be a #rrggbb color or a layer color name `{key}`은(는) #rrggbb 색상이나 레이어 색상 이름이어야 합니다 @msg unknown Live Paint option `{key}` 알 수 없는 라이브 페인트 옵션 `{key}` @msg unknown Shape Builder option `{key}` 알 수 없는 모양 빌더 옵션 `{key}` +@msg unknown Circle tool option `{key}` 알 수 없는 점 기준 원 도구 옵션 `{key}` @msg `{key}` must be a #rrggbb colour `{key}`은(는) #rrggbb 색상이어야 합니다 @msg `{key}` must be a string `{key}`은(는) 문자열이어야 합니다 @msg `{key}` must be a profile name or null `{key}`은(는) 프로파일 이름 또는 null이어야 합니다 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index f40a61047c..41bef3d562 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -4904,6 +4904,7 @@ font-technology Variable Variabel Circle Cirkel Circle Tool Cirkelgereedschap Circle too large Cirkel te groot + From Center Vanuit het midden Clip to Art Clippen op artwork Colorize Inkleuren Gamma Gamma @@ -5379,6 +5380,8 @@ imageTrace Outline Contour @msg no active perspective plane geen actief perspectiefvlak @msg no anchor points selected geen ankerpunten geselecteerd @msg `points` must be two or three [x, y] pairs of numbers `points` moet uit twee of drie getallenparen [x, y] bestaan +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` moet een getallenpaar [x, y] zijn, met één paar [x, y] in `points` +@msg the point in `points` is on `center` het punt in `points` ligt op `center` @msg direct-select two or three anchor points, or give `points` selecteer met directe selectie twee of drie ankerpunten of geef `points` op @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 no app to open files here hier is geen app om bestanden mee te openen @@ -8724,6 +8727,7 @@ swatch Bright Violet Felviolet @msg `{key}` must be a #rrggbb color or a layer color name `{key}` moet een #rrggbb-kleur of de naam van een laagkleur zijn @msg unknown Live Paint option `{key}` onbekende Live Paint-optie `{key}` @msg unknown Shape Builder option `{key}` onbekende Vormopbouw-optie `{key}` +@msg unknown Circle tool option `{key}` onbekende Cirkelgereedschap-optie `{key}` @msg a key object sits on that point op dat punt ligt een sleutelobject @msg a linked image can't become a gradient mesh: embed it first een gekoppelde afbeelding kan geen verloopraster worden: sluit deze eerst in @msg a mask has more than one art block een masker heeft meer dan één illustratieblok diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 52e33d639a..a16737d422 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4472,6 +4472,7 @@ font-technology Variable Zmienne Circle Okrąg Circle Tool Narzędzie Okrąg Circle too large Okrąg jest za duży + From Center Od środka Clip to Art Przytnij do kompozycji Colorize Koloruj Gamma Gamma @@ -4944,6 +4945,7 @@ liquify-list-end {0}, {1} {0} i {1} @msg `{key}` must be a #rrggbb color or a layer color name `{key}` musi być kolorem #rrggbb lub nazwą koloru warstwy @msg unknown Live Paint option `{key}` nieznana opcja aktywnego malowania `{key}` @msg unknown Shape Builder option `{key}` nieznana opcja kreatora kształtów `{key}` +@msg unknown Circle tool option `{key}` nieznana opcja narzędzia Okrąg `{key}` @msg `{key}` must be a #rrggbb colour `{key}` musi być kolorem #rrggbb @msg `{key}` must be a number `{key}` musi być liczbą @msg `{key}` must be a number, not {v} `{key}` musi być liczbą, nie {v} @@ -5140,6 +5142,8 @@ liquify-list-end {0}, {1} {0} i {1} @msg no active perspective plane brak aktywnej płaszczyzny perspektywy @msg no anchor points selected nie zaznaczono punktów kontrolnych @msg `points` must be two or three [x, y] pairs of numbers `points` musi zawierać dwie lub trzy pary liczb [x, y] +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` musi być parą liczb [x, y], a `points` musi zawierać jedną parę [x, y] +@msg the point in `points` is on `center` punkt w `points` leży w `center` @msg direct-select two or three anchor points, or give `points` zaznacz bezpośrednio dwa lub trzy punkty kontrolne lub podaj `points` @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 no app to open files here brak aplikacji do otwierania plików diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 5ae5b28f19..80d4379592 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -448,6 +448,7 @@ antiAlias Sharp Nítido Circle Círculo Circle Tool Ferramenta Círculo Circle too large Círculo grande demais + From Center Do centro Clean Up… Limpar… Clear Limpar Clear All Tabs Limpar Todas as Paradas de Tabulação @@ -4140,6 +4141,7 @@ axis Both Ambos @msg `{key}` must be a #rrggbb color or a layer color name `{key}` deve ser uma cor #rrggbb ou o nome de uma cor de camada @msg unknown Live Paint option `{key}` opção de Pintura ao Vivo desconhecida `{key}` @msg unknown Shape Builder option `{key}` opção do Construtor de Formas desconhecida `{key}` +@msg unknown Circle tool option `{key}` opção da Ferramenta Círculo desconhecida `{key}` @msg `{key}` must be a #rrggbb colour `{key}` deve ser uma cor #rrggbb @msg `{key}` must be a number `{key}` deve ser um número @msg `{key}` must be a number, not {v} `{key}` deve ser um número, não {v} @@ -4326,6 +4328,8 @@ axis Both Ambos @msg no active perspective plane nenhum plano de perspectiva ativo @msg no anchor points selected nenhum ponto de ancoragem selecionado @msg `points` must be two or three [x, y] pairs of numbers `points` deve ter dois ou três pares de números [x, y] +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` deve ser um par de números [x, y], com um par [x, y] em `points` +@msg the point in `points` is on `center` o ponto em `points` está em `center` @msg direct-select two or three anchor points, or give `points` selecione diretamente dois ou três pontos de ancoragem ou informe `points` @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 no app to open files here nenhum aplicativo para abrir arquivos aqui diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 3dc089a76d..d989b704ad 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -479,6 +479,7 @@ font-technology Variable Вариативные Circle Круг Circle Tool Инструмент «Круг» Circle too large Круг слишком большой + From Center От центра Classic Defaults Классические значения по умолчанию Clean Up… Очистить… Clear Очистить @@ -4850,6 +4851,7 @@ liquify-list-end {0}, {1} {0} и {1} @msg `{key}` must be a #rrggbb color or a layer color name `{key}` должно быть цветом #rrggbb или названием цвета слоя @msg unknown Live Paint option `{key}` неизвестный параметр быстрой заливки `{key}` @msg unknown Shape Builder option `{key}` неизвестный параметр создания фигур `{key}` +@msg unknown Circle tool option `{key}` неизвестный параметр инструмента «Круг» `{key}` @msg `{key}` must be a #rrggbb colour `{key}` должно быть цветом #rrggbb @msg `{key}` must be a number `{key}` должно быть числом @msg `{key}` must be a number, not {v} `{key}` должно быть числом, а не {v} @@ -5046,6 +5048,8 @@ liquify-list-end {0}, {1} {0} и {1} @msg no active perspective plane нет активной плоскости перспективы @msg no anchor points selected опорные точки не выделены @msg `points` must be two or three [x, y] pairs of numbers `points` должен содержать две или три пары чисел [x, y] +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` должен быть парой чисел [x, y], а `points` должен содержать одну пару [x, y] +@msg the point in `points` is on `center` точка в `points` совпадает с `center` @msg direct-select two or three anchor points, or give `points` выделите прямым выделением две или три опорные точки или задайте `points` @msg no circle passes through these points: two are the same or all three lie on one line через эти точки не проходит ни одна окружность: две точки совпадают или все три лежат на одной прямой @msg no app to open files here здесь нет приложения для открытия файлов diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 5e852da822..b73bee10cf 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -469,6 +469,7 @@ font-technology Variable Variabla Circle Cirkel Circle Tool Cirkelverktyg Circle too large Cirkeln är för stor + From Center Från mitten Classic Defaults Klassiska standardvärden Clean Up… Rensa upp… Clear Rensa @@ -4732,6 +4733,7 @@ liquify-list-end {0}, {1} {0} och {1} @msg `{key}` must be a #rrggbb color or a layer color name `{key}` måste vara en färg i formatet #rrggbb eller namnet på en lagerfärg @msg unknown Live Paint option `{key}` okänt alternativ för direktmålning `{key}` @msg unknown Shape Builder option `{key}` okänt alternativ för formbyggaren `{key}` +@msg unknown Circle tool option `{key}` okänt alternativ för cirkelverktyget `{key}` @msg `{key}` must be a #rrggbb colour `{key}` måste vara en färg i formatet #rrggbb @msg `{key}` must be a number `{key}` måste vara ett tal @msg `{key}` must be a number, not {v} `{key}` måste vara ett tal, inte {v} @@ -4919,6 +4921,8 @@ liquify-list-end {0}, {1} {0} och {1} @msg no active perspective plane inget aktivt perspektivplan @msg no anchor points selected inga ankarpunkter är markerade @msg `points` must be two or three [x, y] pairs of numbers `points` måste vara två eller tre talpar [x, y] +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` måste vara ett talpar [x, y], med ett talpar [x, y] i `points` +@msg the point in `points` is on `center` punkten i `points` ligger på `center` @msg direct-select two or three anchor points, or give `points` direktmarkera två eller tre ankarpunkter eller ange `points` @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 no app to open files here det finns ingen app för att öppna filer här diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index 97fccd9167..c31053c943 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -475,6 +475,23 @@ fn objects_on_path_detach_strings_are_in_complete_catalogs() { } } +/// The errors `tool.setOption` gives for the Circle tool's options (the tools crate is not one of +/// [`MESSAGE_CRATES`]) are translated in every complete-message language, with the key kept. +#[test] +fn circle_tool_option_errors_translate() { + let errors = [serde_json::json!({ "fromCenter": 1 }), serde_json::json!({ "radius": 5 })].map(|v| { + let map = v.as_object().cloned().unwrap_or_default(); + vectorcraft_tools::circle::check_options(&map).expect_err("refused") + }); + for code in COMPLETE_MESSAGES { + let lang = Lang::from_code(code).expect("registered"); + for (error, key) in errors.iter().zip(["fromCenter", "radius"]) { + let shown = message(lang, error); + assert!(shown != *error && shown.contains(key), "{code}: {shown}"); + } + } +} + /// The Window › Brush Libraries menu, built from the built-in library table, names each library. #[test] fn built_in_brush_library_names_are_in_complete_catalogs() { diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index de1d7280f1..fa6f1c4cab 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -463,6 +463,7 @@ font-technology Variable Değişken Circle daire Circle Tool Daire Aracı Circle too large Daire çok büyük + From Center Merkezden Classic Defaults Klasik Varsayılanlar Clean Up… Temizleme… Clear Temizle @@ -4739,6 +4740,8 @@ liquify-list-end {0}, {1} {0} ve {1} @msg no active perspective plane aktif perspektif düzlemi yok @msg no anchor points selected bağlantı noktası seçilmedi @msg `points` must be two or three [x, y] pairs of numbers `points` iki veya üç [x, y] sayı çifti olmalıdır +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` bir [x, y] sayı çifti olmalı ve `points` bir [x, y] çifti içermelidir +@msg the point in `points` is on `center` `points` içindeki nokta `center` üzerinde @msg direct-select two or three anchor points, or give `points` iki veya üç bağlantı noktasını doğrudan seçin veya `points` verin @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 no app to open files here burada dosyaları açacak uygulama yok @@ -6475,6 +6478,7 @@ theme Appearance Görünüm @msg `{key}` must be a #rrggbb color or a layer color name `{key}` bir #rrggbb rengi ya da katman rengi adı olmalıdır @msg unknown Live Paint option `{key}` bilinmeyen Canlı Boyama seçeneği `{key}` @msg unknown Shape Builder option `{key}` bilinmeyen Şekil Oluşturucu seçeneği `{key}` +@msg unknown Circle tool option `{key}` bilinmeyen Daire Aracı seçeneği `{key}` @msg a key object sits on that point bu noktanın üzerinde bir anahtar nesne bulunuyor @msg a linked image can't become a gradient mesh: embed it first bağlantılı bir görüntü degrade ağına dönüştürülemez: önce görüntüyü gömün @msg a mask has more than one art block bir maskede birden fazla çizim bloğu var diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index e82439dca3..c4cd777c36 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -477,6 +477,7 @@ font-technology Variable Варіативні Circle Коло Circle Tool Інструмент «Коло» Circle too large Коло завелике + From Center Від центру Classic Defaults Класичні значення за промовчанням Clean Up… Очистити… Clear Очистити @@ -4840,6 +4841,7 @@ liquify-list-end {0}, {1} {0} і {1} @msg `{key}` must be a #rrggbb color or a layer color name `{key}` має бути кольором #rrggbb або назвою кольору шару @msg unknown Live Paint option `{key}` невідомий параметр швидкої заливки `{key}` @msg unknown Shape Builder option `{key}` невідомий параметр створення фігур `{key}` +@msg unknown Circle tool option `{key}` невідомий параметр інструмента «Коло» `{key}` @msg `{key}` must be a #rrggbb colour `{key}` має бути кольором #rrggbb @msg `{key}` must be a number `{key}` має бути числом @msg `{key}` must be a number, not {v} `{key}` має бути числом, а не {v} @@ -5036,6 +5038,8 @@ liquify-list-end {0}, {1} {0} і {1} @msg no active perspective plane немає активної площини перспективи @msg no anchor points selected опорні точки не виділені @msg `points` must be two or three [x, y] pairs of numbers `points` має містити дві або три пари чисел [x, y] +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` має бути парою чисел [x, y], а `points` має містити одну пару [x, y] +@msg the point in `points` is on `center` точка в `points` збігається з `center` @msg direct-select two or three anchor points, or give `points` виділіть дві або три опорні точки прямим виділенням або задайте `points` @msg no circle passes through these points: two are the same or all three lie on one line через ці точки не проходить жодне коло: дві точки збігаються або всі три лежать на одній прямій @msg no app to open files here тут немає програми для відкриття файлів diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 0f088fec2b..f9dbf1c514 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -559,6 +559,7 @@ font-technology Variable Biến thiên Circle Hình tròn Circle Tool Công cụ Hình tròn Circle too large Hình tròn quá lớn + From Center Từ tâm Classic Cổ điển Classic Defaults Mặc định cổ điển Clean Up… Dọn dẹp… @@ -4844,6 +4845,7 @@ theme Appearance Giao diện @msg `{key}` must be a #rrggbb color or a layer color name `{key}` phải là màu #rrggbb hoặc tên màu lớp @msg unknown Live Paint option `{key}` tùy chọn Tô trực tiếp không xác định `{key}` @msg unknown Shape Builder option `{key}` tùy chọn Tạo hình dạng không xác định `{key}` +@msg unknown Circle tool option `{key}` tùy chọn Công cụ Hình tròn không xác định `{key}` @msg `{key}` must be a #rrggbb colour `{key}` phải là màu #rrggbb @msg `{key}` must be a number `{key}` phải là một số @msg `{key}` must be a number, not {v} `{key}` phải là một số, không phải {v} @@ -5368,6 +5370,8 @@ liquify-list-end {0}, {1} {0} và {1} @msg no active perspective plane không có mặt phẳng phối cảnh đang hoạt động @msg no anchor points selected chưa chọn điểm neo @msg `points` must be two or three [x, y] pairs of numbers `points` phải là hai hoặc ba cặp số [x, y] +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` phải là một cặp số [x, y], với một cặp [x, y] trong `points` +@msg the point in `points` is on `center` điểm trong `points` nằm tại `center` @msg direct-select two or three anchor points, or give `points` hãy chọn trực tiếp hai hoặc ba điểm neo hoặc cung cấp `points` @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 no app to open files here không có ứng dụng để mở tệp ở đây diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index ed027b9f23..ebab6472b3 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -430,6 +430,7 @@ antiAlias Sharp 锐利 Circle 圆形 Circle Tool 圆形工具 Circle too large 圆形过大 + From Center 从中心 Classic Defaults 经典默认 Clean Up… 清理… Clear 清除 @@ -4544,6 +4545,8 @@ imageTrace Outline 轮廓 @msg clipboard is empty 剪贴板为空 @msg no anchor points selected 未选择锚点 @msg `points` must be two or three [x, y] pairs of numbers `points` 必须是两对或三对数字 [x, y] +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` 必须是一对数字 [x, y],且 `points` 中须有一对 [x, y] +@msg the point in `points` is on `center` `points` 中的点与 `center` 重合 @msg direct-select two or three anchor points, or give `points` 请直接选择两个或三个锚点,或提供 `points` @msg no circle passes through these points: two are the same or all three lie on one line 没有圆经过这些点:有两点相同,或三点共线 @msg select at least two objects 请至少选择两个对象 @@ -6455,6 +6458,7 @@ lighting Light 光源 @msg `{key}` must be a #rrggbb color or a layer color name `{key}` 必须是 #rrggbb 格式的颜色或图层颜色名称 @msg unknown Live Paint option `{key}` 未知的实时上色选项 `{key}` @msg unknown Shape Builder option `{key}` 未知的形状生成器选项 `{key}` +@msg unknown Circle tool option `{key}` 未知的圆形工具选项 `{key}` @msg a linked image can't become a gradient mesh: embed it first 链接的图像无法转换为渐变网格:请先嵌入它 @msg the image has no usable size or position 图像没有可用的尺寸或位置 @msg the image's pixels can't be read 无法读取图像的像素 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index d5d613a7d8..35df9f4e58 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -445,6 +445,7 @@ font-technology Variable 可變 Circle 圓形 Circle Tool 圓形工具 Circle too large 圓形過大 + From Center 從中心 Classic Defaults 經典預設值 Clean Up… 清除… Clear 清除 @@ -2077,6 +2078,8 @@ file-filter Templates 範本 @msg clipboard is empty 剪貼簿是空的 @msg no anchor points selected 未選取錨點 @msg `points` must be two or three [x, y] pairs of numbers `points` 必須是兩組或三組數字 [x, y] +@msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` 必須是一組數字 [x, y],且 `points` 中須有一組 [x, y] +@msg the point in `points` is on `center` `points` 中的點與 `center` 重合 @msg direct-select two or three anchor points, or give `points` 請以直接選取方式選取兩個或三個錨點,或提供 `points` @msg no circle passes through these points: two are the same or all three lie on one line 沒有圓通過這些點:有兩點相同,或三點共線 @msg select at least two objects 請選取至少兩個物件 @@ -2986,6 +2989,7 @@ liquify-list-end {0}, {1} {0}和{1} @msg `{key}` must be a #rrggbb color or a layer color name `{key}` 必須是 #rrggbb 格式的顏色或圖層顏色名稱 @msg unknown Live Paint option `{key}` 未知的即時上色選項 `{key}` @msg unknown Shape Builder option `{key}` 未知的形狀建立選項 `{key}` +@msg unknown Circle tool option `{key}` 未知的圓形工具選項 `{key}` @msg a linked image can't become a gradient mesh: embed it first 連結的影像無法轉換為漸層網格:請先內嵌 @msg the image has no usable size or position 影像沒有可用的尺寸或位置 @msg the image's pixels can't be read 無法讀取影像的像素 diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs index 3c78f12df0..32bc9a02fa 100644 --- a/crates/ui-egui/src/toolbar.rs +++ b/crates/ui-egui/src/toolbar.rs @@ -495,10 +495,10 @@ pub fn open_options(app: &mut VectorcraftApp, tool: &str) -> Result Date: Tue, 17 Nov 2026 17:26:49 -0800 Subject: [PATCH 2/7] Shapes: a centered Circle tool release draws the circle it shows With From Center, a second press moved less than 2 screen points now draws the outline through the pointer the preview follows, not through the point of the press. A second click on the center still places nothing. --- crates/tools/src/circle.rs | 5 +++-- crates/tools/src/circle/tests.rs | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/crates/tools/src/circle.rs b/crates/tools/src/circle.rs index 8f16210542..99ec88f6e7 100644 --- a/crates/tools/src/circle.rs +++ b/crates/tools/src/circle.rs @@ -285,9 +285,10 @@ impl Tool for CircleTool { // a drag from there draws the circle on the diameter it drags out. (Some(Press::Second { on_first: true, dragged: false, .. }), ..) => vec![], (Some(Press::Second { on_first: true, dragged: true, .. }), Some(a), Some(c)) => self.draw(&[a, c]), + // From a center: the outline passes through the point the tool shows it on, where + // the drag ends or, within DRAG_PX of the press, where the pointer last was. + (Some(Press::Second { .. }), Some(a), Some(c)) if self.centered => self.draw(&[a, c]), (Some(Press::Second { at, dragged: false, .. }), Some(a), _) => self.draw(&[a, at]), - // From a center: the outline passes through the point the drag ends on. - (Some(Press::Second { dragged: true, .. }), Some(a), Some(c)) if self.centered => self.draw(&[a, c]), // Three points: Alt's rounding of the diameter does not apply. (Some(Press::Second { snapped, dragged: true, .. }), Some(a), Some(c)) => self.draw(&[a, snapped, c]), _ => vec![], diff --git a/crates/tools/src/circle/tests.rs b/crates/tools/src/circle/tests.rs index 0b2336f278..32875b186d 100644 --- a/crates/tools/src/circle/tests.rs +++ b/crates/tools/src/circle/tests.rs @@ -409,6 +409,27 @@ fn from_center_two_clicks_draw_the_circle_through_the_second() { assert_eq!(drag(&mut t, &cx, (330.0, 340.0), &[(360.0, 300.0)], Mods::default()), centered((300.0, 300.0), (360.0, 300.0))); } +/// With From Center, the release draws the circle the tool shows: a drag from the center ends +/// where it is let go, and a second press moved less than 2 screen points draws the outline +/// through the pointer, not through the point of the press. +#[test] +fn from_center_the_release_draws_the_circle_shown() { + let (d, _) = doc_with_rect(); + let (s, p) = (Selection::default(), paint()); + let cx = ToolContext { smart_guides: false, ..cx(&d, &s, &p) }; + let mut t = from_center(); + t.pointer(&cx, &ev(PointerKind::Down, (300.0, 300.0), Mods::default())); + t.pointer(&cx, &ev(PointerKind::Drag, (380.0, 300.0), Mods::default())); + assert_eq!(t.pointer(&cx, &ev(PointerKind::Up, (400.0, 300.0), Mods::default())), centered((300.0, 300.0), (400.0, 300.0))); + click(&mut t, &cx, (300.0, 300.0)); + t.pointer(&cx, &ev(PointerKind::Down, (330.0, 340.0), Mods::default())); + t.pointer(&cx, &ev(PointerKind::Drag, (331.0, 340.0), Mods::default())); + let shown = preview(&t.overlays(&cx)).expect("the circle is shown"); + let r = Point::new(300.0, 300.0).distance(Point::new(331.0, 340.0)); + assert!(near(shown, Rect::new(300.0 - r, 300.0 - r, 300.0 + r, 300.0 + r)), "{:?}", t.overlays(&cx)); + assert_eq!(t.pointer(&cx, &ev(PointerKind::Up, (331.0, 340.0), Mods::default())), centered((300.0, 300.0), (331.0, 340.0))); +} + /// With From Center, Shift keeps the point at 45° steps from the center, and Alt rounds the /// diameter, twice the radius, to the rulers' ticks (every 5 pt at 100% in points). #[test] From 199860918da1564683b902db67761f9b79d6a6d6 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 17:51:19 -0800 Subject: [PATCH 3/7] Shapes: shape.circleThroughPoints refuses a null center --- crates/engine/src/cmd/create.rs | 5 +++-- crates/engine/src/tests/circle_through.rs | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/cmd/create.rs b/crates/engine/src/cmd/create.rs index 7a5a3633af..88e40c229c 100644 --- a/crates/engine/src/cmd/create.rs +++ b/crates/engine/src/cmd/create.rs @@ -419,8 +419,9 @@ fn ellipse(s: &mut Session, p: &Value) -> Result { fn circle_through_points(s: &mut Session, p: &Value) -> Result { const C: &str = "shape.circleThroughPoints"; const SAME: &str = "no circle passes through these points: two are the same or all three lie on one line"; - let (center, radius) = match p.get("center").filter(|v| !v.is_null()) { - // From a center: the circle at `center` whose edge passes through the one point. + let (center, radius) = match p.get("center") { + // From a center: the circle at `center` whose edge passes through the one point. A null + // `center` is refused, as a null `points` with a center is. Some(c) => { let one = p.get("points").and_then(Value::as_array).and_then(|v| match v.as_slice() { [q] => pair(q), diff --git a/crates/engine/src/tests/circle_through.rs b/crates/engine/src/tests/circle_through.rs index 462838a979..ef504538db 100644 --- a/crates/engine/src/tests/circle_through.rs +++ b/crates/engine/src/tests/circle_through.rs @@ -126,8 +126,8 @@ fn two_points_are_the_ends_of_a_diameter() { /// With `center`, the circle is centered there and its edge passes through the one point in /// `points`: from the bottom-right corner (200, 200) of a 100 pt square through its top-left /// corner (100, 100), the radius is the square's diagonal, in one undo step. A point on the center -/// and a circle past the canvas are refused, and so is a `center` or `points` that is not one -/// `[x, y]` pair of finite numbers; nothing is drawn and no undo step is recorded. +/// and a circle past the canvas are refused, and so is a `center` (null included) or `points` that +/// is not one `[x, y]` pair of finite numbers; nothing is drawn and no undo step is recorded. #[test] fn a_center_and_a_point_on_the_edge_give_the_circle() { let mut s = session(); @@ -157,6 +157,8 @@ fn a_center_and_a_point_on_the_edge_give_the_circle() { (json!([0]), json!([[10, 0]])), (json!("0,0"), json!([[10, 0]])), (json!([0, 0, 1]), json!([[10, 0]])), + (Value::Null, json!([[10, 0]])), + (Value::Null, json!([[10, 0], [20, 0]])), ] { let e = s.execute(C, &json!({ "center": center, "points": points })).unwrap_err().to_string(); assert!(e.contains("`center` must be an [x, y] pair of numbers, with one [x, y] pair in `points`"), "{center} {points}: {e}"); From 35d64a18a6c4866792b13012128c649f7dd5af4c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 17:12:04 -0800 Subject: [PATCH 4/7] Shapes: Circle tool review fixes for From Center - tool.setOption accepts fromCenter again: the Circle tool implements check_option, which the shared option check now calls for every tool. - A drag from the first point that comes back within 2 screen points of the press draws the circle the tool shows. A drag to no circle draws nothing and leaves no point pending. - shape.circleThroughPoints refuses a circle whose opposite edges round to the same number at its coordinates, and the tool no longer shows such a circle. The error is translated in every complete-message catalog. - An option set during a press (tool.setOption, the Control bar) is kept when the press is dropped, with the options that write reset. --- crates/engine/src/cmd/create.rs | 6 ++++- crates/engine/src/tests/circle_through.rs | 14 +++++++++++ crates/engine/src/tests/toolsettings.rs | 26 ++++++++++++++++++++ crates/engine/src/tooling.rs | 29 +++++++++++++++++++++- crates/tools/src/circle.rs | 22 ++++++++++++++--- crates/tools/src/circle/tests.rs | 30 +++++++++++++++++++++++ crates/ui-egui/src/i18n/ca.tsv | 1 + crates/ui-egui/src/i18n/cs.tsv | 1 + crates/ui-egui/src/i18n/da.tsv | 1 + crates/ui-egui/src/i18n/de.tsv | 1 + crates/ui-egui/src/i18n/el.tsv | 1 + crates/ui-egui/src/i18n/es.tsv | 1 + crates/ui-egui/src/i18n/fi.tsv | 1 + crates/ui-egui/src/i18n/fr.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 1 + crates/ui-egui/src/i18n/hu.tsv | 1 + crates/ui-egui/src/i18n/it.tsv | 1 + crates/ui-egui/src/i18n/ja.tsv | 1 + crates/ui-egui/src/i18n/ka.tsv | 1 + crates/ui-egui/src/i18n/ko.tsv | 1 + crates/ui-egui/src/i18n/nl.tsv | 1 + crates/ui-egui/src/i18n/pl.tsv | 1 + crates/ui-egui/src/i18n/pt-br.tsv | 1 + crates/ui-egui/src/i18n/ru.tsv | 1 + crates/ui-egui/src/i18n/sv.tsv | 1 + crates/ui-egui/src/i18n/tr.tsv | 1 + crates/ui-egui/src/i18n/uk.tsv | 1 + crates/ui-egui/src/i18n/vi.tsv | 1 + crates/ui-egui/src/i18n/zh-hans.tsv | 1 + crates/ui-egui/src/i18n/zh-hant.tsv | 1 + docs/mcp.md | 4 ++- 31 files changed, 148 insertions(+), 7 deletions(-) diff --git a/crates/engine/src/cmd/create.rs b/crates/engine/src/cmd/create.rs index b7d84d28b2..7d0a8db3ba 100644 --- a/crates/engine/src/cmd/create.rs +++ b/crates/engine/src/cmd/create.rs @@ -71,7 +71,7 @@ pub fn specs() -> Vec { "Circle Through Points", [], None, - "{points?: [[x, y], [x, y]] or [[x, y], [x, y], [x, y]] (two: the ends of a diameter; left out: the two or three selected anchor points, where a path selected whole counts all its anchors and selected segments' ends do not count), center?: [x, y] (the circle's center; `points` then holds the one point its edge passes through, [[x, y]])} → {id, cx, cy, radius}: a circle with the current paint whose edge passes through the points, not pixel-aligned even while Align New Objects to Pixel Grid is on; two points that are the same, a point on `center`, three on one line, or a circle reaching past the canvas are an error, and nothing is drawn", + "{points?: [[x, y], [x, y]] or [[x, y], [x, y], [x, y]] (two: the ends of a diameter; left out: the two or three selected anchor points, where a path selected whole counts all its anchors and selected segments' ends do not count), center?: [x, y] (the circle's center; `points` then holds the one point its edge passes through, [[x, y]])} → {id, cx, cy, radius}: a circle with the current paint whose edge passes through the points, not pixel-aligned even while Align New Objects to Pixel Grid is on; two points that are the same, a point on `center`, three on one line, a circle reaching past the canvas, or one too small for its edges to differ at its coordinates are an error, and nothing is drawn", has_doc, circle_through_points ), @@ -455,6 +455,10 @@ fn circle_through_points(s: &mut Session, p: &Value) -> Result { } }; let r = Rect::new(center.x - radius, center.y - radius, center.x + radius, center.y + radius); + // A radius below the step between doubles at the center leaves opposite edges on one number. + if !(r.width() > 0.0 && r.height() > 0.0) { + return Err(bad(C, "the circle is too small to draw at these coordinates")); + } let live = LiveShape::Ellipse { w: r.width(), h: r.height(), pie: (0.0, 360.0), xf: Affine::translate(r.origin().to_vec2()) }; // Not pixel-aligned: the circle stays through the points. let mut out = add_art_unaligned(s, "Ellipse", path_kind(live.to_path(), Some(live)))?; diff --git a/crates/engine/src/tests/circle_through.rs b/crates/engine/src/tests/circle_through.rs index ef504538db..f841b56a61 100644 --- a/crates/engine/src/tests/circle_through.rs +++ b/crates/engine/src/tests/circle_through.rs @@ -166,6 +166,20 @@ fn a_center_and_a_point_on_the_edge_give_the_circle() { assert_eq!((undo_len(&s), object_count(&s)), (undo, count)); } +/// A circle so small beside its coordinates that its left and right edges round to the same +/// number (radius 10⁻¹¹ pt at x = 1,048,576, where doubles step by about 2.3 × 10⁻¹⁰) is refused, +/// from a center and on a diameter alike; nothing is drawn and no undo step is recorded. +#[test] +fn a_circle_with_no_width_at_document_precision_is_refused() { + let mut s = session(); + let (undo, count) = (undo_len(&s), object_count(&s)); + for p in [json!({"center": [1_048_576, 0], "points": [[1_048_576, 1e-11]]}), json!({"points": [[1_048_576, 0], [1_048_576, 2e-11]]})] { + let e = s.execute(C, &p).unwrap_err().to_string(); + assert!(e.contains("the circle is too small to draw at these coordinates"), "{p}: {e}"); + } + assert_eq!((undo_len(&s), object_count(&s)), (undo, count)); +} + /// Points that are not two or three pairs of finite numbers are an error, not a fallback. #[test] fn malformed_points_are_refused() { diff --git a/crates/engine/src/tests/toolsettings.rs b/crates/engine/src/tests/toolsettings.rs index 7afdb80aef..42209b6ab1 100644 --- a/crates/engine/src/tests/toolsettings.rs +++ b/crates/engine/src/tests/toolsettings.rs @@ -48,6 +48,32 @@ fn circle_from_center_persists() { assert_eq!(next.tool_options(), json!({"fromCenter": true})); } +/// An option set during a press (`tool.setOption`, or a Control bar change) is kept when the press +/// is dropped: the drop gives back only what the press itself changed. +#[test] +fn an_option_set_during_a_dropped_press_is_kept() { + let v = ViewInfo::default(); + let mut s = session(); + select(&mut s, "circle"); + s.set_tool_option("fromCenter", &json!(true)); + s.pointer(&PointerEvent::new(PointerKind::Down, 100.0, 100.0), v).unwrap(); + s.set_tool_option_cmd(&json!({"key": "fromCenter", "value": false})).unwrap(); + s.drop_tool_press(v).unwrap(); + assert_eq!(s.tool_options(), json!({"fromCenter": false})); + assert_eq!(s.prefs.tool_settings["circle"]["fromCenter"], json!(false)); + s.pointer(&PointerEvent::new(PointerKind::Down, 100.0, 100.0), v).unwrap(); + s.set_tool_option("fromCenter", &json!(true)); + s.drop_tool_press(v).unwrap(); + assert_eq!(s.tool_options(), json!({"fromCenter": true})); + assert_eq!(s.prefs.tool_settings["circle"]["fromCenter"], json!(true)); + // Setting a Parametric Shape's kind also puts its numbers back to that kind's: those are kept too. + select(&mut s, "parametricShape"); + s.pointer(&PointerEvent::new(PointerKind::Down, 100.0, 100.0), v).unwrap(); + let set = s.set_tool_option_cmd(&json!({"key": "kind", "value": "star"})).unwrap(); + s.drop_tool_press(v).unwrap(); + assert_eq!(s.tool_options(), set); +} + #[test] fn options_survive_a_tool_switch() { let mut s = session(); diff --git a/crates/engine/src/tooling.rs b/crates/engine/src/tooling.rs index b144087b6f..19d262117f 100644 --- a/crates/engine/src/tooling.rs +++ b/crates/engine/src/tooling.rs @@ -605,7 +605,8 @@ impl Session { /// Escape, as during a drag, for most tools), and a release returns the tool to rest. Of what /// the tool asks for along the way, only a cancel and a notify run, so a marquee selects /// nothing and a click opens no size dialog. The tool gets back the persistent options it had - /// when the press began, and none of the press's changes to them are stored. A dropped Type + /// when the press began, and none of the press's changes to them are stored; an option set on + /// it during the press (`tool.setOption`, the Control bar) is kept. A dropped Type /// press restores the prior selection. The freeform gradient point selected once the tool /// took the press is selected again. A press held while the tool computes an edit on another /// thread has not reached the tool: it is removed from the held input with the pointer events @@ -1303,9 +1304,31 @@ impl Session { if key == "queue" && self.tool.id() == "place" { self.note_place_queue_roots(); } + let was = self.tool.options(); self.tool.set_option(key, v); self.tool_set_since_reset = true; self.keep_tool_settings(); + self.keep_option_writes_past_a_dropped_press(&was, [key]); + } + + /// Options set on the active tool during a press are written into the options the press began + /// with, so a dropped press ([`Self::drop_tool_press`]) gives back only what the press changed: + /// the options `keys` names, and every other option the write changed from `was` (setting a + /// Parametric Shape's `kind` resets its numbers). + fn keep_option_writes_past_a_dropped_press<'a>(&mut self, was: &Value, keys: impl IntoIterator) { + let now = self.tool.options(); + if let Some((id, before)) = self.press_options.as_mut() + && id == self.tool.id() + { + let keys: Vec<&str> = keys.into_iter().collect(); + for (key, slot) in before.iter_mut() { + if let Some(v) = now.get(key) + && (keys.contains(&key.as_str()) || was.get(key) != Some(v)) + { + *slot = v.clone(); + } + } + } } /// Keep the automation roots in force now as those the place cursor's queue, being loaded, @@ -1359,6 +1382,7 @@ impl Session { // kind puts the shape's other numbers back to that kind's, and those given with it are its. let first = |k: &str| k == "queue" || k == "kind"; let ordered = || values.iter().filter(|(k, _)| first(k)).chain(values.iter().filter(|(k, _)| !first(k))); + let was = self.tool.options(); let mut other = (!active).then(|| self.make_tool(id.unwrap_or_default())); let t = other.as_deref_mut().unwrap_or(self.tool.as_mut()); for (k, v) in ordered() { @@ -1387,6 +1411,9 @@ impl Session { let set = other.id(); Self::restore_stores(&self.prefs, self.tool.as_mut(), |store| settings::stores(set).any(|(s, _)| s == store)); } + if active { + self.keep_option_writes_past_a_dropped_press(&was, values.keys().map(String::as_str)); + } out } diff --git a/crates/tools/src/circle.rs b/crates/tools/src/circle.rs index 99ec88f6e7..388cdab4fb 100644 --- a/crates/tools/src/circle.rs +++ b/crates/tools/src/circle.rs @@ -82,9 +82,10 @@ fn command(points: &[Point], centered: bool) -> (String, Value) { } } -/// Is the circle at `c` with radius `r` inside the canvas? +/// Is the circle at `c` with radius `r` inside the canvas, with its opposite edges on different +/// numbers (as `shape.circleThroughPoints` requires)? fn on_canvas(c: Point, r: f64) -> bool { - [c.x - r, c.y - r, c.x + r, c.y + r].iter().all(|v| v.abs() <= MAX_COORD) + [c.x - r, c.y - r, c.x + r, c.y + r].iter().all(|v| v.abs() <= MAX_COORD) && c.x - r < c.x + r && c.y - r < c.y + r } /// The circle through two points (the ends of a diameter) or three, as `shape.circleThroughPoints` @@ -275,8 +276,16 @@ impl Tool for CircleTool { vec![] } PointerKind::Up => match (self.press.take(), self.first, self.pointer) { - (Some(Press::First { at, dragged: true, .. }), _, Some(b)) if b.distance(at) >= cx.tol(DRAG_PX) => self.draw(&[at, b]), - // A click places the first point; the guides of the press go. + // Once the press has moved DRAG_PX, the release draws the circle the tool shows, also + // where the pointer came back nearer the press; where it shows none, the release + // draws nothing and starts afresh. + (Some(Press::First { at, dragged: true, .. }), _, Some(b)) + if b.distance(at) >= cx.tol(DRAG_PX) || circle_for(&[at, b], self.centered).is_some() => + { + self.draw(&[at, b]) + } + // A click, or a drag back onto the press, places the first point; the guides of the + // press go. (Some(Press::First { .. }), ..) => { self.snap.clear(); vec![] @@ -310,6 +319,11 @@ impl Tool for CircleTool { } } + /// [`check_options`] for one option. + fn check_option(&self, key: &str, value: &Value) -> Result<(), String> { + check_options(&Map::from_iter([(key.to_string(), value.clone())])) + } + fn key(&mut self, _cx: &ToolContext, key: ToolKey, _mods: Mods) -> Vec { if key == ToolKey::Escape { self.clear(); diff --git a/crates/tools/src/circle/tests.rs b/crates/tools/src/circle/tests.rs index 32875b186d..e8377dc478 100644 --- a/crates/tools/src/circle/tests.rs +++ b/crates/tools/src/circle/tests.rs @@ -430,6 +430,28 @@ fn from_center_the_release_draws_the_circle_shown() { assert_eq!(t.pointer(&cx, &ev(PointerKind::Up, (331.0, 340.0), Mods::default())), centered((300.0, 300.0), (331.0, 340.0))); } +/// Once a press has moved 2 screen points, its release draws the circle the tool shows, also when +/// the pointer comes back nearer than that: from a center and on a diameter. A drag back onto the +/// press itself shows no circle and places the first point, as a click does. +#[test] +fn a_drag_brought_back_near_its_press_draws_the_circle_shown() { + let (d, _) = doc_with_rect(); + let (s, p) = (Selection::default(), paint()); + let cx = ToolContext { smart_guides: false, ..cx(&d, &s, &p) }; + let mut t = from_center(); + assert_eq!(drag(&mut t, &cx, (300.0, 300.0), &[(320.0, 300.0), (301.0, 300.0)], Mods::default()), centered((300.0, 300.0), (301.0, 300.0))); + assert!(!t.ends_on_escape(&cx), "no center is left pending"); + let mut t = CircleTool::default(); + assert_eq!(drag(&mut t, &cx, (300.0, 300.0), &[(320.0, 300.0), (301.0, 300.0)], Mods::default()), circle(&[(300.0, 300.0), (301.0, 300.0)])); + assert!(!t.ends_on_escape(&cx)); + assert_eq!(drag(&mut t, &cx, (300.0, 300.0), &[(320.0, 300.0), (300.0, 300.0)], Mods::default()), vec![]); + assert!(t.ends_on_escape(&cx), "the first point is placed"); + t.key(&cx, ToolKey::Escape, Mods::default()); + // A drag to a circle past the canvas draws nothing and leaves no point behind. + assert_eq!(drag(&mut t, &cx, (300.0, 300.0), &[(4.1e6, 300.0)], Mods::default()), vec![]); + assert!(!t.ends_on_escape(&cx), "nothing is left pending"); +} + /// With From Center, Shift keeps the point at 45° steps from the center, and Alt rounds the /// diameter, twice the radius, to the rulers' ticks (every 5 pt at 100% in points). #[test] @@ -467,6 +489,10 @@ fn from_center_holds_for_the_circle_being_drawn() { assert_eq!(drag(&mut t, &cx, (300.0, 300.0), &[(380.0, 360.0)], Mods::default()), circle(&[(300.0, 300.0), (380.0, 360.0)])); assert_eq!(circle_for(&[Point::new(1.0, 1.0), Point::new(1.0, 1.0)], true), None); assert!(too_large(&[Point::new(0.0, 0.0), Point::new(4.1e6, 0.0)], true)); + // Edges that round to one number at document precision, as `shape.circleThroughPoints` refuses. + let x = 1_048_576.0; + assert_eq!(circle_for(&[Point::new(x, 0.0), Point::new(x, 1e-11)], true), None); + assert_eq!(circle_of(&[Point::new(x, 0.0), Point::new(x, 2e-11)]), None); t.set_option("fromCenter", &json!("yes")); assert_eq!(t.options(), json!({ "fromCenter": false }), "a value that is not true or false is ignored"); } @@ -478,6 +504,10 @@ fn the_options_are_checked() { assert_eq!(check_options(&map(json!({ "fromCenter": true }))), Ok(())); assert_eq!(check_options(&map(json!({ "fromCenter": 1 }))), Err("`fromCenter` must be true or false".into())); assert_eq!(check_options(&map(json!({ "radius": 5 }))), Err("unknown Circle tool option `radius`".into())); + let t = CircleTool::default(); + assert_eq!(t.check_option("fromCenter", &json!(false)), Ok(())); + assert_eq!(t.check_option("fromCenter", &json!(1)), Err("`fromCenter` must be true or false".into())); + assert_eq!(t.check_option("radius", &json!(5)), Err("unknown Circle tool option `radius`".into())); } /// The tool is in the Ellipse tool's group, after the Ellipse tool. diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index fdf1c5c881..bb588caef8 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -6609,6 +6609,7 @@ liquify-list-end {0}, {1} {0} i {1} @msg `points` must be two or three [x, y] pairs of numbers `points` han de ser dos o tres parells de nombres [x, y] @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` ha de ser un parell de nombres [x, y], amb un parell [x, y] a `points` @msg the point in `points` is on `center` el punt de `points` és a `center` +@msg the circle is too small to draw at these coordinates el cercle és massa petit per dibuixar-lo en aquestes coordenades @msg direct-select two or three anchor points, or give `points` seleccioneu directament dos o tres punts d’ancoratge o indiqueu `points` @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 no app to open files here aquí no hi ha cap aplicació per obrir fitxers diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 6b79156ede..4664964b19 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -5511,6 +5511,7 @@ liquify-list-end {0}, {1} {0} a {1} @msg `points` must be two or three [x, y] pairs of numbers `points` musí být dvě nebo tři dvojice čísel [x, y] @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` musí být dvojice čísel [x, y] a `points` musí obsahovat jednu dvojici [x, y] @msg the point in `points` is on `center` bod v `points` leží na `center` +@msg the circle is too small to draw at these coordinates kruh je na těchto souřadnicích příliš malý na vykreslení @msg direct-select two or three anchor points, or give `points` vyberte přímým výběrem dva nebo tři kotevní body, nebo zadejte `points` @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 no app to open files here zde chybí aplikace pro otevírání souborů diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 3b1edf35e0..9811af3cc9 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -7685,6 +7685,7 @@ imageTrace Outline Kontur @msg `points` must be two or three [x, y] pairs of numbers `points` skal være to eller tre talpar [x, y] @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` skal være et talpar [x, y], med ét talpar [x, y] i `points` @msg the point in `points` is on `center` punktet i `points` ligger på `center` +@msg the circle is too small to draw at these coordinates cirklen er for lille til at tegne ved disse koordinater @msg direct-select two or three anchor points, or give `points` direkte markér to eller tre ankerpunkter, eller angiv `points` @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 no app to open files here ingen app til at åbne filer her diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 97b9689e89..f924c7cae0 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -5106,6 +5106,7 @@ liquify-list-end {0}, {1} {0} und {1} @msg `points` must be two or three [x, y] pairs of numbers `points` muss aus zwei oder drei Zahlenpaaren [x, y] bestehen @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` muss ein Zahlenpaar [x, y] sein, mit einem Paar [x, y] in `points` @msg the point in `points` is on `center` der Punkt in `points` liegt auf `center` +@msg the circle is too small to draw at these coordinates der Kreis ist zu klein, um ihn an diesen Koordinaten zu zeichnen @msg direct-select two or three anchor points, or give `points` wählen Sie zwei oder drei Ankerpunkte direkt aus oder geben Sie `points` an @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 no app to open files here hier gibt es keine App zum Öffnen von Dateien diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 708fdbdea6..5023e79736 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -5163,6 +5163,7 @@ digits Malayalam Μαλαγιάλαμ @msg `points` must be two or three [x, y] pairs of numbers το `points` πρέπει να είναι δύο ή τρία ζεύγη αριθμών [x, y] @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` το `center` πρέπει να είναι ένα ζεύγος αριθμών [x, y], με ένα ζεύγος [x, y] στο `points` @msg the point in `points` is on `center` το σημείο στο `points` βρίσκεται πάνω στο `center` +@msg the circle is too small to draw at these coordinates ο κύκλος είναι πολύ μικρός για να σχεδιαστεί σε αυτές τις συντεταγμένες @msg direct-select two or three anchor points, or give `points` επιλέξτε άμεσα δύο ή τρία σημεία αγκύρωσης ή δώστε `points` @msg no circle passes through these points: two are the same or all three lie on one line κανένας κύκλος δεν περνά από αυτά τα σημεία: δύο είναι ίδια ή και τα τρία βρίσκονται σε μία ευθεία @msg no app to open files here δεν υπάρχει εφαρμογή για άνοιγμα αρχείων εδώ diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 5a9f2c6745..b24ca7345e 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -5218,6 +5218,7 @@ liquify-list-end {0}, {1} {0}, {1} @msg `points` must be two or three [x, y] pairs of numbers `points` debe ser dos o tres pares de números [x, y] @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` debe ser un par de números [x, y], con un par [x, y] en `points` @msg the point in `points` is on `center` el punto de `points` está en `center` +@msg the circle is too small to draw at these coordinates el círculo es demasiado pequeño para dibujarlo en estas coordenadas @msg direct-select two or three anchor points, or give `points` seleccione directamente dos o tres puntos de ancla o indique `points` @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 no app to open files here aquí no hay ninguna aplicación para abrir archivos diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 939fba5136..369fd5c84d 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -5429,6 +5429,7 @@ liquify-list-end {0}, {1} {0} ja {1} @msg `points` must be two or three [x, y] pairs of numbers `points` on annettava kahtena tai kolmena lukuparina [x, y] @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` on annettava lukuparina [x, y], ja `points` sisältää yhden lukuparin [x, y] @msg the point in `points` is on `center` `points`-kohdan piste on `center`-kohdassa +@msg the circle is too small to draw at these coordinates ympyrä on liian pieni piirrettäväksi näissä koordinaateissa @msg direct-select two or three anchor points, or give `points` valitse suoraan kaksi tai kolme ankkuripistettä tai anna `points` @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 no app to open files here täällä ei ole sovellusta tiedostojen avaamiseen diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index e176a346f5..54451dc567 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -5177,6 +5177,7 @@ liquify-list-end {0}, {1} {0} et {1} @msg `points` must be two or three [x, y] pairs of numbers `points` doit contenir deux ou trois paires de nombres [x, y] @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` doit être une paire de nombres [x, y], avec une paire [x, y] dans `points` @msg the point in `points` is on `center` le point de `points` est sur `center` +@msg the circle is too small to draw at these coordinates le cercle est trop petit pour être dessiné à ces coordonnées @msg direct-select two or three anchor points, or give `points` sélectionnez deux ou trois points d’ancrage avec l’outil Sélection directe, ou indiquez `points` @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 no app to open files here aucune application pour ouvrir des fichiers ici diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 55a8d59b38..c153796e96 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -8113,6 +8113,7 @@ liquify-list-end {0}, {1} {0} और {1} @msg `points` must be two or three [x, y] pairs of numbers `points` में संख्याओं के दो या तीन [x, y] जोड़े होने चाहिए @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` संख्याओं का एक [x, y] जोड़ा होना चाहिए, और `points` में एक [x, y] जोड़ा होना चाहिए @msg the point in `points` is on `center` `points` का बिंदु `center` पर है +@msg the circle is too small to draw at these coordinates इन निर्देशांकों पर बनाने के लिए वृत्त बहुत छोटा है @msg direct-select two or three anchor points, or give `points` दो या तीन एंकर पॉइंट्स डायरेक्ट-सिलेक्ट करें, या `points` दें @msg no circle passes through these points: two are the same or all three lie on one line इन पॉइंट्स से होकर कोई वृत्त नहीं गुज़रता: दो एक जैसे हैं या तीनों एक ही रेखा पर हैं @msg no app to open files here यहां फ़ाइलों को ओपन करने के लिए कोई ऐप नहीं है diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index f4c96c7a18..cce0dd257b 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -5882,6 +5882,7 @@ liquify-list-end {0}, {1} {0} és {1} @msg `points` must be two or three [x, y] pairs of numbers a `points` két vagy három [x, y] számpár legyen @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` a `center` egy [x, y] számpár legyen, a `points` pedig egy [x, y] párt tartalmazzon @msg the point in `points` is on `center` a `points` pontja a `center` helyén van +@msg the circle is too small to draw at these coordinates a kör túl kicsi ahhoz, hogy ezeken a koordinátákon megrajzolható legyen @msg direct-select two or three anchor points, or give `points` jelölj ki közvetlen kijelöléssel két vagy három horgonypontot, vagy add meg a `points` értéket @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 no app to open files here itt nincs fájlmegnyitó alkalmazás diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index e19aacb767..e9367355da 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -5244,6 +5244,7 @@ liquify-list-end {0}, {1} {0} e {1} @msg `points` must be two or three [x, y] pairs of numbers `points` deve essere composto da due o tre coppie di numeri [x, y] @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` deve essere una coppia di numeri [x, y], con una coppia [x, y] in `points` @msg the point in `points` is on `center` il punto in `points` si trova su `center` +@msg the circle is too small to draw at these coordinates il cerchio è troppo piccolo per essere disegnato a queste coordinate @msg direct-select two or three anchor points, or give `points` seleziona con Selezione diretta due o tre punti di ancoraggio oppure indica `points` @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 no app to open files here nessuna app per aprire file qui diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 59566c624e..0068177ecf 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -5006,6 +5006,7 @@ variable-list-end {0}, {1} {0}、{1} @msg `points` must be two or three [x, y] pairs of numbers `points` は 2 組または 3 組の数値 [x, y] にしてください @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` は数値の組 [x, y] にし、`points` には [x, y] を 1 組指定してください @msg the point in `points` is on `center` `points` の点が `center` と同じ位置にあります +@msg the circle is too small to draw at these coordinates 円が小さすぎるため、この座標には描画できません @msg direct-select two or three anchor points, or give `points` アンカーポイントを 2 つまたは 3 つダイレクト選択するか、`points` を指定してください @msg no circle passes through these points: two are the same or all three lie on one line これらの点を通る円はありません: 2 つの点が同じか、3 点すべてが一直線上にあります @msg select at least two objects オブジェクトを 2 つ以上選択してください diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 2efcf36d22..c087fe47a4 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -6970,6 +6970,7 @@ font-technology Variable ცვლადი @msg `points` must be two or three [x, y] pairs of numbers `points` უნდა იყოს რიცხვების ორი ან სამი [x, y] წყვილი @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` უნდა იყოს რიცხვების [x, y] წყვილი, ხოლო `points` უნდა შეიცავდეს ერთ [x, y] წყვილს @msg the point in `points` is on `center` `points`-ის წერტილი `center`-ზეა +@msg the circle is too small to draw at these coordinates წრე ძალიან პატარაა ამ კოორდინატებზე დასახატად @msg direct-select two or three anchor points, or give `points` პირდაპირი მონიშვნით მონიშნეთ ორი ან სამი საყრდენი წერტილი ან მიუთითეთ `points` @msg no circle passes through these points: two are the same or all three lie on one line ამ წერტილებზე წრეწირი არ გადის: ორი ერთნაირია ან სამივე ერთ წრფეზე მდებარეობს @msg no app to open files here აქ ფაილების გასახსნელი აპი არ არის diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 8a842f9b71..f60b5a4eb7 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -4935,6 +4935,7 @@ variable-list-end {0}, {1} {0} 및 {1} @msg `points` must be two or three [x, y] pairs of numbers `points`는 숫자 쌍 [x, y] 두 개 또는 세 개여야 합니다 @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center`는 숫자 쌍 [x, y]이고 `points`에는 [x, y] 쌍이 하나 있어야 합니다 @msg the point in `points` is on `center` `points`의 점이 `center`에 있습니다 +@msg the circle is too small to draw at these coordinates 원이 너무 작아 이 좌표에서 그릴 수 없습니다 @msg direct-select two or three anchor points, or give `points` 앵커 포인트 두 개 또는 세 개를 직접 선택하거나 `points`를 지정하세요 @msg no circle passes through these points: two are the same or all three lie on one line 이 점들을 지나는 원이 없습니다: 두 점이 같거나 세 점이 모두 한 직선 위에 있습니다 @msg select at least two objects 개체를 두 개 이상 선택하세요 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 27092ebd7d..001884c62b 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -5560,6 +5560,7 @@ imageTrace Outline Contour @msg `points` must be two or three [x, y] pairs of numbers `points` moet uit twee of drie getallenparen [x, y] bestaan @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` moet een getallenpaar [x, y] zijn, met één paar [x, y] in `points` @msg the point in `points` is on `center` het punt in `points` ligt op `center` +@msg the circle is too small to draw at these coordinates de cirkel is te klein om op deze coördinaten te tekenen @msg direct-select two or three anchor points, or give `points` selecteer met directe selectie twee of drie ankerpunten of geef `points` op @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 no app to open files here hier is geen app om bestanden mee te openen diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index c26579b579..a2e7599dc5 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -5328,6 +5328,7 @@ liquify-list-end {0}, {1} {0} i {1} @msg `points` must be two or three [x, y] pairs of numbers `points` musi zawierać dwie lub trzy pary liczb [x, y] @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` musi być parą liczb [x, y], a `points` musi zawierać jedną parę [x, y] @msg the point in `points` is on `center` punkt w `points` leży w `center` +@msg the circle is too small to draw at these coordinates okrąg jest zbyt mały, aby go narysować w tych współrzędnych @msg direct-select two or three anchor points, or give `points` zaznacz bezpośrednio dwa lub trzy punkty kontrolne lub podaj `points` @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 no app to open files here brak aplikacji do otwierania plików diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 461b2b188e..9a946817dc 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -4474,6 +4474,7 @@ axis Both Ambos @msg `points` must be two or three [x, y] pairs of numbers `points` deve ter dois ou três pares de números [x, y] @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` deve ser um par de números [x, y], com um par [x, y] em `points` @msg the point in `points` is on `center` o ponto em `points` está em `center` +@msg the circle is too small to draw at these coordinates o círculo é pequeno demais para ser desenhado nessas coordenadas @msg direct-select two or three anchor points, or give `points` selecione diretamente dois ou três pontos de ancoragem ou informe `points` @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 no app to open files here nenhum aplicativo para abrir arquivos aqui diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 3833801529..cd4b6a34ce 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -5239,6 +5239,7 @@ liquify-list-end {0}, {1} {0} и {1} @msg `points` must be two or three [x, y] pairs of numbers `points` должен содержать две или три пары чисел [x, y] @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` должен быть парой чисел [x, y], а `points` должен содержать одну пару [x, y] @msg the point in `points` is on `center` точка в `points` совпадает с `center` +@msg the circle is too small to draw at these coordinates круг слишком мал, чтобы нарисовать его в этих координатах @msg direct-select two or three anchor points, or give `points` выделите прямым выделением две или три опорные точки или задайте `points` @msg no circle passes through these points: two are the same or all three lie on one line через эти точки не проходит ни одна окружность: две точки совпадают или все три лежат на одной прямой @msg no app to open files here здесь нет приложения для открытия файлов diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 486ad17e33..479b960195 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -5103,6 +5103,7 @@ liquify-list-end {0}, {1} {0} och {1} @msg `points` must be two or three [x, y] pairs of numbers `points` måste vara två eller tre talpar [x, y] @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` måste vara ett talpar [x, y], med ett talpar [x, y] i `points` @msg the point in `points` is on `center` punkten i `points` ligger på `center` +@msg the circle is too small to draw at these coordinates cirkeln är för liten för att ritas vid dessa koordinater @msg direct-select two or three anchor points, or give `points` direktmarkera två eller tre ankarpunkter eller ange `points` @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 no app to open files here det finns ingen app för att öppna filer här diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 17f712e5e9..847aa2c502 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -4931,6 +4931,7 @@ liquify-list-end {0}, {1} {0} ve {1} @msg `points` must be two or three [x, y] pairs of numbers `points` iki veya üç [x, y] sayı çifti olmalıdır @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` bir [x, y] sayı çifti olmalı ve `points` bir [x, y] çifti içermelidir @msg the point in `points` is on `center` `points` içindeki nokta `center` üzerinde +@msg the circle is too small to draw at these coordinates daire bu koordinatlarda çizilemeyecek kadar küçük @msg direct-select two or three anchor points, or give `points` iki veya üç bağlantı noktasını doğrudan seçin veya `points` verin @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 no app to open files here burada dosyaları açacak uygulama yok diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 0da8c07841..a9419f974e 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -5228,6 +5228,7 @@ liquify-list-end {0}, {1} {0} і {1} @msg `points` must be two or three [x, y] pairs of numbers `points` має містити дві або три пари чисел [x, y] @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` має бути парою чисел [x, y], а `points` має містити одну пару [x, y] @msg the point in `points` is on `center` точка в `points` збігається з `center` +@msg the circle is too small to draw at these coordinates коло занадто мале, щоб намалювати його в цих координатах @msg direct-select two or three anchor points, or give `points` виділіть дві або три опорні точки прямим виділенням або задайте `points` @msg no circle passes through these points: two are the same or all three lie on one line через ці точки не проходить жодне коло: дві точки збігаються або всі три лежать на одній прямій @msg no app to open files here тут немає програми для відкриття файлів diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 4c77ae1c5b..d11f1f4ff0 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -5575,6 +5575,7 @@ liquify-list-end {0}, {1} {0} và {1} @msg `points` must be two or three [x, y] pairs of numbers `points` phải là hai hoặc ba cặp số [x, y] @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` phải là một cặp số [x, y], với một cặp [x, y] trong `points` @msg the point in `points` is on `center` điểm trong `points` nằm tại `center` +@msg the circle is too small to draw at these coordinates hình tròn quá nhỏ để vẽ tại các tọa độ này @msg direct-select two or three anchor points, or give `points` hãy chọn trực tiếp hai hoặc ba điểm neo hoặc cung cấp `points` @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 no app to open files here không có ứng dụng để mở tệp ở đây diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 4602582363..7f3734ae01 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -4701,6 +4701,7 @@ imageTrace Outline 轮廓 @msg `points` must be two or three [x, y] pairs of numbers `points` 必须是两对或三对数字 [x, y] @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` 必须是一对数字 [x, y],且 `points` 中须有一对 [x, y] @msg the point in `points` is on `center` `points` 中的点与 `center` 重合 +@msg the circle is too small to draw at these coordinates 圆太小,无法在这些坐标处绘制 @msg direct-select two or three anchor points, or give `points` 请直接选择两个或三个锚点,或提供 `points` @msg no circle passes through these points: two are the same or all three lie on one line 没有圆经过这些点:有两点相同,或三点共线 @msg select at least two objects 请至少选择两个对象 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 8adc28406f..fc73a5308d 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -2152,6 +2152,7 @@ file-filter Templates 範本 @msg `points` must be two or three [x, y] pairs of numbers `points` 必須是兩組或三組數字 [x, y] @msg `center` must be an [x, y] pair of numbers, with one [x, y] pair in `points` `center` 必須是一組數字 [x, y],且 `points` 中須有一組 [x, y] @msg the point in `points` is on `center` `points` 中的點與 `center` 重合 +@msg the circle is too small to draw at these coordinates 圓太小,無法在這些座標處繪製 @msg direct-select two or three anchor points, or give `points` 請以直接選取方式選取兩個或三個錨點,或提供 `points` @msg no circle passes through these points: two are the same or all three lie on one line 沒有圓通過這些點:有兩點相同,或三點共線 @msg select at least two objects 請選取至少兩個物件 diff --git a/docs/mcp.md b/docs/mcp.md index eb1c620a22..8b86caa800 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -6699,7 +6699,9 @@ out and the selection does not hold two or three anchor points of paths. `shape.circleThroughPoints {center: [x, y], points: [[x, y]]}` draws the circle centered at `center` whose edge passes through the one point in `points`: its radius is the distance between them. It returns an error and draws nothing when the point is on `center`, when the circle would reach past the canvas, and when `center` is not a pair of numbers or -`points` does not hold exactly one pair. With `center`, the selected anchor points are not used. +`points` does not hold exactly one pair. With `center`, the selected anchor points are not used. With or without +`center`, a circle whose radius is so small beside its coordinates that its opposite edges round to the same number is +an error, and nothing is drawn. The Circle tool, after the Ellipse tool in its toolbar group, draws with this command. A drag from one point to another, or a click on each, draws the circle with the two points as the ends of a diameter. A click on a first point, From 0a74c7d0c2ab635655ed476c5d1ee3c6c885099a Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 14:11:17 -0800 Subject: [PATCH 5/7] Shapes: a Circle tool release near the press keeps the press's point from a center too A second press from a center let go within 2 screen points of the press showed the circle through the pointer but drew it through the press, and the tests for a drag brought back near its press asked for the opposite of the click rule on main. The preview of such a press now shows the pressed point until it has been dragged, and the tests follow the rule that a first press let go near its press places the first point. --- crates/tools/src/circle.rs | 12 ++++++------ crates/tools/src/circle/tests.rs | 24 +++++++++++------------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/crates/tools/src/circle.rs b/crates/tools/src/circle.rs index e68a4d85c7..456d27f947 100644 --- a/crates/tools/src/circle.rs +++ b/crates/tools/src/circle.rs @@ -165,8 +165,9 @@ impl CircleTool { Some(Press::First { .. }) | None => out.extend(self.pointer.filter(|_| self.first.is_some())), // A press on the first point adds no point: a drag from it drags out a diameter. Some(Press::Second { on_first: true, dragged, .. }) => out.extend(self.pointer.filter(|_| dragged)), - // From a center, the second point follows the pointer. - Some(Press::Second { .. }) if self.centered => out.extend(self.pointer), + // From a center, the second point follows the pointer once the press has been dragged; + // until then it is the pressed point, which a release within DRAG_PX draws through. + Some(Press::Second { dragged: true, .. }) if self.centered => out.extend(self.pointer), Some(Press::Second { at, dragged: false, .. }) => out.push(at), Some(Press::Second { snapped, dragged: true, .. }) => { out.push(snapped); @@ -296,9 +297,8 @@ impl Tool for CircleTool { vec![] } PointerKind::Up => match (self.press.take(), self.first, self.pointer) { - // Once the press has moved DRAG_PX, the release draws the circle the tool shows, also - // where the pointer came back nearer the press; where it shows none, the release - // draws nothing and starts afresh. + // A release DRAG_PX or more from the press draws the circle the tool shows; where it + // shows none, the release draws nothing and starts afresh. (Some(Press::First { at, dragged: true, .. }), _, Some(b)) if b.distance(at) >= cx.tol(DRAG_PX) || circle_for(&[at, b], self.centered).is_some() => { @@ -315,7 +315,7 @@ impl Tool for CircleTool { (Some(Press::Second { on_first: true, dragged: false, .. }), ..) => vec![], (Some(Press::Second { on_first: true, dragged: true, .. }), Some(a), Some(c)) => self.draw(&[a, c]), // From a center: the outline passes through the point the tool shows it on, where - // the drag ends or, within DRAG_PX of the press, where the pointer last was. + // the drag ends or, within DRAG_PX of the press, the pressed point. (Some(Press::Second { .. }), Some(a), Some(c)) if self.centered => self.draw(&[a, c]), (Some(Press::Second { at, dragged: false, .. }), Some(a), _) => self.draw(&[a, at]), // Three points: Alt's rounding of the diameter does not apply. diff --git a/crates/tools/src/circle/tests.rs b/crates/tools/src/circle/tests.rs index c075d715a5..d9354a96fd 100644 --- a/crates/tools/src/circle/tests.rs +++ b/crates/tools/src/circle/tests.rs @@ -473,8 +473,8 @@ fn from_center_two_clicks_draw_the_circle_through_the_second() { } /// With From Center, the release draws the circle the tool shows: a drag from the center ends -/// where it is let go, and a second press moved less than 2 screen points draws the outline -/// through the pointer, not through the point of the press. +/// where it is let go, and a second press moved less than 2 screen points shows and draws the +/// outline through the point of the press. #[test] fn from_center_the_release_draws_the_circle_shown() { let (d, _) = doc_with_rect(); @@ -488,26 +488,24 @@ fn from_center_the_release_draws_the_circle_shown() { t.pointer(&cx, &ev(PointerKind::Down, (330.0, 340.0), Mods::default())); t.pointer(&cx, &ev(PointerKind::Drag, (331.0, 340.0), Mods::default())); let shown = preview(&t.overlays(&cx)).expect("the circle is shown"); - let r = Point::new(300.0, 300.0).distance(Point::new(331.0, 340.0)); + let r = Point::new(300.0, 300.0).distance(Point::new(330.0, 340.0)); assert!(near(shown, Rect::new(300.0 - r, 300.0 - r, 300.0 + r, 300.0 + r)), "{:?}", t.overlays(&cx)); - assert_eq!(t.pointer(&cx, &ev(PointerKind::Up, (331.0, 340.0), Mods::default())), centered((300.0, 300.0), (331.0, 340.0))); + assert_eq!(t.pointer(&cx, &ev(PointerKind::Up, (331.0, 340.0), Mods::default())), centered((300.0, 300.0), (330.0, 340.0))); } -/// Once a press has moved 2 screen points, its release draws the circle the tool shows, also when -/// the pointer comes back nearer than that: from a center and on a diameter. A drag back onto the -/// press itself shows no circle and places the first point, as a click does. +/// A first press let go within 2 screen points of where it was pressed is a click also after a +/// drag that came back to it, from a center and on a diameter: it places the first point. #[test] -fn a_drag_brought_back_near_its_press_draws_the_circle_shown() { +fn a_first_press_dragged_back_near_its_press_places_the_first_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 = from_center(); - assert_eq!(drag(&mut t, &cx, (300.0, 300.0), &[(320.0, 300.0), (301.0, 300.0)], Mods::default()), centered((300.0, 300.0), (301.0, 300.0))); - assert!(!t.ends_on_escape(&cx), "no center is left pending"); + assert_eq!(drag(&mut t, &cx, (300.0, 300.0), &[(320.0, 300.0), (301.0, 300.0)], Mods::default()), vec![]); + assert!(t.ends_on_escape(&cx), "the center is placed"); + assert_eq!(click(&mut t, &cx, (380.0, 300.0)), centered((300.0, 300.0), (380.0, 300.0))); let mut t = CircleTool::default(); - assert_eq!(drag(&mut t, &cx, (300.0, 300.0), &[(320.0, 300.0), (301.0, 300.0)], Mods::default()), circle(&[(300.0, 300.0), (301.0, 300.0)])); - assert!(!t.ends_on_escape(&cx)); - assert_eq!(drag(&mut t, &cx, (300.0, 300.0), &[(320.0, 300.0), (300.0, 300.0)], Mods::default()), vec![]); + assert_eq!(drag(&mut t, &cx, (300.0, 300.0), &[(320.0, 300.0), (301.0, 300.0)], Mods::default()), vec![]); assert!(t.ends_on_escape(&cx), "the first point is placed"); t.key(&cx, ToolKey::Escape, Mods::default()); // A drag to a circle past the canvas draws nothing and leaves no point behind. From 6c1eb02a57a544e6105721f86d5df49dba1f6fcf Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 20 Nov 2026 07:06:06 -0800 Subject: [PATCH 6/7] Circle: From Center tests compare against the Circle Tool Options defaults The two Circle From Center tests in the engine's tool settings compared the tool's options with {"fromCenter": ...} alone. Since the Circle tool also reports the Circle Tool Options (center, radii, diameter, color, standardAnchors and dragThird), the tests take the options the tool starts with and check that only fromCenter changes. --- crates/engine/src/tests/toolsettings.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/tests/toolsettings.rs b/crates/engine/src/tests/toolsettings.rs index 96d75a78a7..998d88dbff 100644 --- a/crates/engine/src/tests/toolsettings.rs +++ b/crates/engine/src/tests/toolsettings.rs @@ -35,17 +35,19 @@ fn blob_tip_options_report_and_persist() { fn circle_from_center_persists() { let mut s = session(); select(&mut s, "circle"); - assert_eq!(s.tool_options(), json!({"fromCenter": false})); + let mut want = s.tool_options(); + assert_eq!(want["fromCenter"], json!(false)); + want["fromCenter"] = json!(true); s.set_tool_option("fromCenter", &json!(true)); select(&mut s, "selection"); select(&mut s, "circle"); - assert_eq!(s.tool_options(), json!({"fromCenter": true})); + assert_eq!(s.tool_options(), want); select(&mut s, "selection"); let saved = serde_json::to_string(&s.prefs).unwrap(); let mut next = session(); next.apply_prefs(serde_json::from_str(&saved).unwrap()); select(&mut next, "circle"); - assert_eq!(next.tool_options(), json!({"fromCenter": true})); + assert_eq!(next.tool_options(), want); } /// An option set during a press (`tool.setOption`, or a Control bar change) is kept when the press @@ -55,16 +57,19 @@ fn the_circle_from_center_set_during_a_dropped_press_is_kept() { let v = ViewInfo::default(); let mut s = session(); select(&mut s, "circle"); + let mut want = s.tool_options(); s.set_tool_option("fromCenter", &json!(true)); s.pointer(&PointerEvent::new(PointerKind::Down, 100.0, 100.0), v).unwrap(); s.set_tool_option_cmd(&json!({"key": "fromCenter", "value": false})).unwrap(); s.drop_tool_press(v).unwrap(); - assert_eq!(s.tool_options(), json!({"fromCenter": false})); + want["fromCenter"] = json!(false); + assert_eq!(s.tool_options(), want); assert_eq!(s.prefs.tool_settings["circle"]["fromCenter"], json!(false)); s.pointer(&PointerEvent::new(PointerKind::Down, 100.0, 100.0), v).unwrap(); s.set_tool_option("fromCenter", &json!(true)); s.drop_tool_press(v).unwrap(); - assert_eq!(s.tool_options(), json!({"fromCenter": true})); + want["fromCenter"] = json!(true); + assert_eq!(s.tool_options(), want); assert_eq!(s.prefs.tool_settings["circle"]["fromCenter"], json!(true)); // Setting a Parametric Shape's kind also puts its numbers back to that kind's: those are kept too. select(&mut s, "parametricShape"); From cecaf16baea2ecb17285b7825c7544c2ae8e00cf Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 24 Nov 2026 20:39:34 -0800 Subject: [PATCH 7/7] Circle: switching Third Point by Dragging keeps a center placed with From Center --- crates/tools/src/circle.rs | 3 ++- crates/tools/src/circle/tests.rs | 18 ++++++++++++++++++ docs/mcp.md | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/crates/tools/src/circle.rs b/crates/tools/src/circle.rs index 738141a993..37c0e33bcd 100644 --- a/crates/tools/src/circle.rs +++ b/crates/tools/src/circle.rs @@ -640,7 +640,8 @@ impl Tool for CircleTool { if let Some(switch) = self.options.switch(key) { *switch = on; } - if self.options.drag_third != was { + // A circle drawn from its center has no third point, so its center stays placed. + if self.options.drag_third != was && !self.centered { self.clear(); } } diff --git a/crates/tools/src/circle/tests.rs b/crates/tools/src/circle/tests.rs index 20cf56977b..3264a771e8 100644 --- a/crates/tools/src/circle/tests.rs +++ b/crates/tools/src/circle/tests.rs @@ -857,6 +857,24 @@ fn from_center_holds_for_the_circle_being_drawn() { assert_eq!(t.options()["fromCenter"], json!(false), "a value that is not true or false is ignored"); } +/// Switching `dragThird` while a center is placed keeps the center: the circle from it is still +/// drawn. Without From Center, the switch drops the point placed. +#[test] +fn switching_third_point_by_dragging_keeps_a_placed_center() { + let (d, _) = doc_with_rect(); + let (s, p) = (Selection::default(), paint()); + let cx = ToolContext { smart_guides: false, ..cx(&d, &s, &p) }; + let mut t = from_center(); + click(&mut t, &cx, (100.0, 100.0)); + t.set_option("dragThird", &json!(false)); + assert!(t.ends_on_escape(&cx), "the center is still placed"); + assert_eq!(click(&mut t, &cx, (100.0, 150.0)), centered((100.0, 100.0), (100.0, 150.0))); + let mut t = CircleTool::default(); + click(&mut t, &cx, (100.0, 100.0)); + t.set_option("dragThird", &json!(false)); + assert!(!t.ends_on_escape(&cx), "the first point is dropped"); +} + /// `tool.setOption` takes `fromCenter` as true or false, and no other key. #[test] fn the_options_are_checked() { diff --git a/docs/mcp.md b/docs/mcp.md index da42323ebe..78e18df020 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -7396,7 +7396,7 @@ default except `fromCenter`, which is off, and `color` is `"blue"`: the opposite corner, with the diagonal as its radius. Shift keeps the second point at 45° steps from the center, and Alt rounds the diameter (twice the distance from the center) to the nearest ruler tick. The tool shows one radius, to the pointer. A second click on the center places nothing. The setting in force when the first point is placed applies - to that circle, and `dragThird` does not apply to it. + to that circle, and `dragThird` does not apply to it: switching `dragThird` keeps a placed center. `tool.setOption` returns an error and changes none of the options when a value is not one the option takes (`` `radii` must be true or false ``, `` `color` must be one of red, blue, magenta, green, black, gray ``) or the key is