mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-17 15:26:12 +00:00
Arc: arcs follow the axes General › Constrain Angle turns
With a Constrain Angle other than 0° or a whole turn, an arc dragged out with the Arc tool or placed from the Arc Segment Tool Options click dialog is drawn along the turned x and y axes, with its bounding box turned. The drag's box and Shift's equal lengths are measured along those axes, the reference point stays at the drag's corner or the click, and F, C and Up/Down keep the turn. At 0° and whole turns arcs are drawn as before. shape.arc takes an optional rotation (degrees clockwise, about x1, y1 or about the reference point x, y); a rotation that is not a number is an error and adds nothing.
This commit is contained in:
@@ -64,7 +64,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Arc",
|
||||
[],
|
||||
None,
|
||||
"{x1, y1, x2, y2, closed?, slope?} or {x, y, lengthX, lengthY, reference?, baseAlong?: x|y, slope?, closed?, fillArc?} → {id}",
|
||||
"{x1, y1, x2, y2, closed?, slope?, rotation?: deg clockwise about (x1, y1)} or {x, y, lengthX, lengthY, reference?, baseAlong?: x|y, slope?, closed?, fillArc?, rotation?: deg clockwise about the reference point (x, y)} (0: upright) → {id}",
|
||||
has_doc,
|
||||
arc
|
||||
),
|
||||
@@ -299,7 +299,8 @@ fn path_kind(path: PathData, live: Option<LiveShape>) -> NodeKind {
|
||||
/// (<https://helpx.adobe.com/illustrator/desktop/manage-objects/arrange-objects/rotate-objects-by-specific-angles.html>):
|
||||
/// a box (rectangle, ellipse, grid) runs along the turned axes from `pivot`, the point the dialog
|
||||
/// placed at the click (its top-left corner `x`, `y`, or a grid's reference point), which stays
|
||||
/// put; a polygon or star turns its base orientation about its centre. The params as they are at
|
||||
/// put; an arc sized by its lengths turns about its reference point `x`, `y`, which the dialog
|
||||
/// placed at the click; a polygon or star turns its base orientation about its centre. The params as they are at
|
||||
/// 0° or a whole turn, for other commands and when they already carry a `rotation`.
|
||||
pub fn constrain_click(s: &Session, cmd: &str, mut params: Value, pivot: Point) -> Value {
|
||||
let base = s.prefs.constrain_angle;
|
||||
@@ -318,6 +319,9 @@ pub fn constrain_click(s: &Session, cmd: &str, mut params: Value, pivot: Point)
|
||||
"shape.polygon" | "shape.star" => {
|
||||
o.insert("rotation".into(), json!(rotation));
|
||||
}
|
||||
"shape.arc" if o.contains_key("lengthX") || o.contains_key("lengthY") => {
|
||||
o.insert("rotation".into(), json!(rotation));
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
params
|
||||
@@ -590,13 +594,18 @@ fn spiral(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
}
|
||||
|
||||
fn arc(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let rotation = if p.get("rotation").is_some() { f64_req(p, "rotation", "shape.arc")? } else { 0.0 };
|
||||
if !rotation.is_finite() {
|
||||
return Err(bad("shape.arc", "rotation must be finite"));
|
||||
}
|
||||
let closed = switch_or(p, "closed", false, "shape.arc")?;
|
||||
let fill_arc = switch_or(p, "fillArc", false, "shape.arc")?;
|
||||
let base_x = !matches!(p.get("baseAlong").and_then(Value::as_str), Some("y" | "Y"));
|
||||
let path = if p.get("lengthX").is_some() || p.get("lengthY").is_some() {
|
||||
// The upright path, and the point `rotation` turns it about.
|
||||
let (path, pivot) = if p.get("lengthX").is_some() || p.get("lengthY").is_some() {
|
||||
let anchor = Point::new(f64_req(p, "x", "shape.arc")?, f64_req(p, "y", "shape.arc")?);
|
||||
let reference = p.get("reference").and_then(Value::as_u64).unwrap_or(0) as usize;
|
||||
shapes::arc_segment(
|
||||
let path = shapes::arc_segment(
|
||||
anchor,
|
||||
reference,
|
||||
number_or(p, "lengthX", 100.0, "shape.arc")?,
|
||||
@@ -604,12 +613,21 @@ fn arc(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
base_x,
|
||||
number_or(p, "slope", 50.0, "shape.arc")?,
|
||||
closed,
|
||||
)
|
||||
);
|
||||
(path, anchor)
|
||||
} else {
|
||||
let a = Point::new(f64_req(p, "x1", "shape.arc")?, f64_req(p, "y1", "shape.arc")?);
|
||||
let b = Point::new(f64_req(p, "x2", "shape.arc")?, f64_req(p, "y2", "shape.arc")?);
|
||||
let slope = number_or(p, "slope", 100.0, "shape.arc")?;
|
||||
shapes::arc(a, b, slope, closed, base_x)
|
||||
(shapes::arc(a, b, slope, closed, base_x), a)
|
||||
};
|
||||
// 0 and whole turns leave the path as it is; quarter turns are exact.
|
||||
let bbox_angle = bbox_turn(rotation);
|
||||
let path = if bbox_angle == 0.0 {
|
||||
path
|
||||
} else {
|
||||
let c = pivot.to_vec2();
|
||||
path.transformed(Affine::translate(c) * vectorcraft_geom::rotate_deg(rotation) * Affine::translate(-c))
|
||||
};
|
||||
let fill = if fill_arc { s.paint.fill.clone() } else { vectorcraft_color::Paint::None };
|
||||
let look = s.new_art_look(
|
||||
@@ -617,7 +635,7 @@ fn arc(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
if s.paint.stroke.is_none() { vectorcraft_color::Paint::solid(vectorcraft_color::Color::BLACK) } else { s.paint.stroke.clone() },
|
||||
s.paint.stroke_width.max(0.1),
|
||||
);
|
||||
add_look(s, "Arc", path_kind(path, None), look, None)
|
||||
insert_look_turned(s, "Arc", path_kind(path, None), look, None, true, bbox_angle)
|
||||
}
|
||||
|
||||
/// The grid `paths` (bottom first) as one selected group in the new-art stroke, filled with the
|
||||
|
||||
@@ -412,3 +412,97 @@ fn constrain_angle_turns_a_click_made_grid_about_its_reference_point() {
|
||||
let b = bounds(&s, id);
|
||||
assert_eq!((b.x0, b.y0, b.x1, b.y1), (175.0, 150.0, 225.0, 250.0), "turned about the click: {b:?}");
|
||||
}
|
||||
|
||||
/// The anchor points of the path `id`.
|
||||
fn path_points(s: &Session, id: NodeId) -> Vec<Point> {
|
||||
match &s.doc().unwrap().doc.node(id).unwrap().kind {
|
||||
NodeKind::Path { path, .. } => path.subpaths.iter().flat_map(|sp| sp.anchors.iter().map(|a| a.p)).collect(),
|
||||
other => panic!("a path: {other:?}"),
|
||||
}
|
||||
}
|
||||
|
||||
/// The direction (degrees, counter-clockwise on the page) of the arc `id`'s first handle.
|
||||
fn first_handle_angle(s: &Session, id: NodeId) -> f64 {
|
||||
let NodeKind::Path { path, .. } = &s.doc().unwrap().doc.node(id).unwrap().kind else { panic!("a path") };
|
||||
let a = &path.subpaths[0].anchors[0];
|
||||
let v = a.h_out - a.p;
|
||||
(-v.y).atan2(v.x).to_degrees()
|
||||
}
|
||||
|
||||
fn near(p: Point, x: f64, y: f64) -> bool {
|
||||
close(p.x, x) && close(p.y, y)
|
||||
}
|
||||
|
||||
/// An arc dragged out runs along the turned axes: at 30° it still runs from the drag's start to
|
||||
/// its end, its base leaves the start along the turned x axis and its bounding box turns 30°; at
|
||||
/// 0° it is as before.
|
||||
#[test]
|
||||
fn constrain_angle_draws_a_dragged_arc_along_the_turned_axes() {
|
||||
let mut s = new_doc();
|
||||
for (deg, handle) in [(0.0, 0.0), (30.0, 30.0)] {
|
||||
set_angle(&mut s, deg);
|
||||
s.select_tool("arc", ViewInfo::default()).unwrap();
|
||||
gesture(&mut s, Mods::default(), &[(Down, 100.0, 100.0), (Drag, 130.0, 110.0), (Drag, 160.0, 120.0), (Up, 160.0, 120.0)]);
|
||||
let id = last_id(&s);
|
||||
let pts = path_points(&s, id);
|
||||
assert!(near(pts[0], 100.0, 100.0) && near(pts[1], 160.0, 120.0), "{deg}°: {pts:?}");
|
||||
assert!(close(first_handle_angle(&s, id), handle), "{deg}°: {}", first_handle_angle(&s, id));
|
||||
if deg == 0.0 {
|
||||
assert_eq!(bbox_angle(&s, id).to_bits(), 0.0f64.to_bits());
|
||||
} else {
|
||||
assert!(close(bbox_angle(&s, id), 30.0), "{}", bbox_angle(&s, id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// An arc placed by the click dialog keeps its reference point at the click and runs its lengths
|
||||
/// along the turned axes: at 30° from the top-left reference point, and at 90° about the center
|
||||
/// one; at 0° the dialog's params are unchanged.
|
||||
#[test]
|
||||
fn constrain_angle_turns_a_click_made_arc_about_its_reference_point() {
|
||||
let mut s = new_doc();
|
||||
let params = |reference: u64, x: f64, y: f64| json!({"x": x, "y": y, "lengthX": 100, "lengthY": 50, "reference": reference, "baseAlong": "x", "slope": 50, "closed": false, "fillArc": false});
|
||||
let click = Point::new(200.0, 200.0);
|
||||
let p = params(0, 200.0, 200.0);
|
||||
assert_eq!(constrain_click(&s, "shape.arc", p.clone(), click), p, "0°");
|
||||
set_angle(&mut s, 30.0);
|
||||
let turned = constrain_click(&s, "shape.arc", p, click);
|
||||
assert_eq!(turned["rotation"], json!(-30.0));
|
||||
let id = NodeId(s.execute("shape.arc", &turned).unwrap()["id"].as_u64().unwrap());
|
||||
let pts = path_points(&s, id);
|
||||
let r = 30f64.to_radians();
|
||||
let end = (200.0 + 100.0 * r.cos() + 50.0 * r.sin(), 200.0 - 100.0 * r.sin() + 50.0 * r.cos());
|
||||
assert!(near(pts[0], 200.0, 200.0) && near(pts[1], end.0, end.1), "{pts:?} vs {end:?}");
|
||||
assert!(close(bbox_angle(&s, id), 30.0));
|
||||
set_angle(&mut s, 90.0);
|
||||
let p = constrain_click(&s, "shape.arc", params(4, 200.0, 200.0), click);
|
||||
let id = NodeId(s.execute("shape.arc", &p).unwrap()["id"].as_u64().unwrap());
|
||||
// The ends at opposite corners of the 100 × 50 box centered on the click, turned exactly.
|
||||
assert_eq!(path_points(&s, id), vec![Point::new(175.0, 250.0), Point::new(225.0, 150.0)]);
|
||||
let b = bounds(&s, id);
|
||||
assert!(close(b.x0, 175.0) && close(b.y0, 150.0) && close(b.x1, 225.0) && close(b.y1, 250.0), "turned about the click: {b:?}");
|
||||
assert_eq!(bbox_angle(&s, id), 90.0);
|
||||
}
|
||||
|
||||
/// `shape.arc` turns by an explicit `rotation` (clockwise) about `x1`, `y1` or about its reference
|
||||
/// point; a `rotation` that is not a number is refused and adds nothing.
|
||||
#[test]
|
||||
fn arc_rotation_turns_it_and_must_be_a_number() {
|
||||
let mut s = new_doc();
|
||||
let id = NodeId(s.execute("shape.arc", &json!({"x1": 0, "y1": 0, "x2": 10, "y2": 20, "rotation": 90})).unwrap()["id"].as_u64().unwrap());
|
||||
let pts = path_points(&s, id);
|
||||
assert!(near(pts[0], 0.0, 0.0) && near(pts[1], -20.0, 10.0), "{pts:?}");
|
||||
assert_eq!(bbox_angle(&s, id), -90.0, "a quarter turn clockwise");
|
||||
let id =
|
||||
NodeId(s.execute("shape.arc", &json!({"x": 50, "y": 50, "lengthX": 10, "lengthY": 20, "rotation": 360})).unwrap()["id"].as_u64().unwrap());
|
||||
assert_eq!(path_points(&s, id), vec![Point::new(50.0, 50.0), Point::new(60.0, 70.0)], "a whole turn leaves it upright");
|
||||
assert_eq!(bbox_angle(&s, id).to_bits(), 0.0f64.to_bits());
|
||||
for bad in [json!("x"), Value::Null] {
|
||||
for p in
|
||||
[json!({"x1": 0, "y1": 0, "x2": 10, "y2": 20, "rotation": bad}), json!({"x": 0, "y": 0, "lengthX": 10, "lengthY": 20, "rotation": bad})]
|
||||
{
|
||||
assert!(s.execute("shape.arc", &p).is_err(), "{p}");
|
||||
assert_eq!(last_id(&s), id, "nothing added for {p}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ use serde_json::{Value, json};
|
||||
use vectorcraft_geom::Point;
|
||||
|
||||
use crate::guides::{DrawSnap, Leave};
|
||||
use crate::shape::{box_params, drag_rect, turned_box};
|
||||
use crate::shape::{box_params, turned_box};
|
||||
use crate::{Action, Cursor, Mods, Overlay, PointerEvent, PointerKind, Tool, ToolContext, ToolKey};
|
||||
|
||||
/// How much ↑ or ↓ changes the arc's slope while it is dragged out.
|
||||
@@ -155,17 +155,13 @@ impl FamilyTool {
|
||||
}
|
||||
|
||||
/// How the dragged point keeps to the start: a spiral's radius goes anywhere, the arc's and
|
||||
/// the grids' corner keeps to a diagonal with Shift (a grid's square is taken along the
|
||||
/// Constrain Angle's axes instead when it turns them, [`Self::command_at`]).
|
||||
/// the grids' corner keeps to a diagonal with Shift (an arc's or a grid's square is taken along
|
||||
/// the Constrain Angle's axes instead when it turns them, [`Self::command_at`]).
|
||||
fn leave(&self, cx: &ToolContext, start: Point, m: Mods) -> Option<Leave> {
|
||||
let turned = self.is_grid() && vectorcraft_geom::constrain_axes(cx.constrain_angle).is_some();
|
||||
let turned = vectorcraft_geom::constrain_axes(cx.constrain_angle).is_some();
|
||||
(self.id != "spiral").then(|| Leave::diagonal(start, m.shift && !turned))
|
||||
}
|
||||
|
||||
fn is_grid(&self) -> bool {
|
||||
matches!(self.id, "rectangularGrid" | "polarGrid")
|
||||
}
|
||||
|
||||
/// The natural logarithm of the radius of the inner end of a spiral of outer radius `r` drawn
|
||||
/// with the tool's decay and segments (a logarithm, so that a low decay with many segments does
|
||||
/// not round to 0). The decay ratio is clamped to 0.05…0.9999 as `shapes::spiral` clamps it.
|
||||
@@ -245,7 +241,7 @@ impl FamilyTool {
|
||||
}
|
||||
|
||||
/// [`Self::command`] with General › Constrain Angle `base` (degrees, counter-clockwise): the
|
||||
/// grids are drawn along the x and y axes turned by it, as the rectangle is.
|
||||
/// arc and the grids are drawn along the x and y axes turned by it, as the rectangle is.
|
||||
pub fn command_at(&self, start: Point, p: Point, m: Mods, base: f64) -> (String, Value) {
|
||||
match self.id {
|
||||
"spiral" => {
|
||||
@@ -263,25 +259,30 @@ impl FamilyTool {
|
||||
}
|
||||
(format!("shape.{}", self.id), params)
|
||||
}
|
||||
// The arc: its box along the Constrain Angle's axes, with the reference point taken in
|
||||
// that box and turned out onto the page; the arc turns about it.
|
||||
_ => {
|
||||
let r = drag_rect(start, p, m).abs();
|
||||
let (r, axes) = turned_box(start, p, m, base);
|
||||
let r = r.abs();
|
||||
let (w, h) = (r.width().max(1e-9), r.height().max(1e-9));
|
||||
let rp = vectorcraft_geom::reference_point(vectorcraft_geom::Rect::new(0.0, 0.0, w, h), self.reference.min(8));
|
||||
let anchor = Point::new(r.x0 + rp.x, r.y0 + rp.y);
|
||||
(
|
||||
"shape.arc".into(),
|
||||
json!({
|
||||
"x": anchor.x,
|
||||
"y": anchor.y,
|
||||
"lengthX": w,
|
||||
"lengthY": h,
|
||||
"reference": self.reference,
|
||||
"baseAlong": self.base_along,
|
||||
"slope": self.slope,
|
||||
"closed": self.closed,
|
||||
"fillArc": self.fill_arc,
|
||||
}),
|
||||
)
|
||||
let local = Point::new(r.x0 + rp.x, r.y0 + rp.y);
|
||||
let anchor = axes.map_or(local, |a| a * local);
|
||||
let mut params = json!({
|
||||
"x": anchor.x,
|
||||
"y": anchor.y,
|
||||
"lengthX": w,
|
||||
"lengthY": h,
|
||||
"reference": self.reference,
|
||||
"baseAlong": self.base_along,
|
||||
"slope": self.slope,
|
||||
"closed": self.closed,
|
||||
"fillArc": self.fill_arc,
|
||||
});
|
||||
if let Some(rotation) = axes.and_then(|_| vectorcraft_geom::constrain_rotation(base)) {
|
||||
params["rotation"] = json!(rotation);
|
||||
}
|
||||
("shape.arc".into(), params)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -433,8 +434,8 @@ impl Tool for FamilyTool {
|
||||
let mut o = self.snap.guides().to_vec();
|
||||
if let Some(s) = self.start.filter(|_| self.began && cx.measurement_labels) {
|
||||
// The size as drawn (from the centre with Alt, square with Shift).
|
||||
// A grid's along the Constrain Angle's axes, as it is drawn.
|
||||
let r = if self.is_grid() { turned_box(s, self.last, self.mods, cx.constrain_angle).0 } else { drag_rect(s, self.last, self.mods) };
|
||||
// An arc's or a grid's along the Constrain Angle's axes, as it is drawn.
|
||||
let r = turned_box(s, self.last, self.mods, cx.constrain_angle).0;
|
||||
let (w, h) = if self.id == "spiral" { ((self.last - s).x.abs(), (self.last - s).y.abs()) } else { (r.width(), r.height()) };
|
||||
o.push(Overlay::Measure { p: self.last, text: cx.size_label(w, h) });
|
||||
}
|
||||
@@ -1080,6 +1081,58 @@ mod tests {
|
||||
assert_eq!(v["rotation"], json!(-30.0));
|
||||
}
|
||||
|
||||
/// General › Constrain Angle: an arc is drawn along the turned axes, its reference point taken
|
||||
/// in the turned box and the arc turned about it; Shift's equal lengths are taken along the
|
||||
/// turned axes, and F, C and ↑ keep the turn and the reference point; at 0° and whole turns
|
||||
/// the arc is as before.
|
||||
#[test]
|
||||
fn arcs_follow_the_constrain_angle() {
|
||||
let t = FamilyTool::new("arc");
|
||||
let (a, b) = (Point::new(100.0, 100.0), Point::new(160.0, 120.0));
|
||||
let flat = t.command(a, b, Mods::default());
|
||||
assert!(flat.1.get("rotation").is_none(), "{flat:?}");
|
||||
assert_eq!(t.command_at(a, b, Mods::default(), 0.0), flat);
|
||||
assert_eq!(t.command_at(a, b, Mods::default(), 360.0), flat);
|
||||
// At 90° the drag runs 20 along the turned x axis and 60 along the turned y axis; the
|
||||
// top-left reference point of that box is at (100, 120) on the page.
|
||||
let (c, v) = t.command_at(a, b, Mods::default(), 90.0);
|
||||
assert_eq!(c, "shape.arc");
|
||||
assert_eq!(
|
||||
v,
|
||||
json!({"x": 100.0, "y": 120.0, "lengthX": 20.0, "lengthY": 60.0, "reference": 0, "baseAlong": "x", "slope": 50.0, "closed": false, "fillArc": false, "rotation": -90.0})
|
||||
);
|
||||
let shift = Mods { shift: true, ..Mods::default() };
|
||||
let (_, v) = t.command_at(a, b, shift, 30.0);
|
||||
assert!((v["lengthX"].as_f64().unwrap() - v["lengthY"].as_f64().unwrap()).abs() < 1e-9, "equal along the turned axes: {v}");
|
||||
assert_eq!(v["rotation"], json!(-30.0));
|
||||
|
||||
// A Shift drag at 30°: the pointer is not held to the page's diagonal.
|
||||
let (d, _) = doc_with_rect();
|
||||
let s = Selection::default();
|
||||
let p = paint();
|
||||
let mut cx = cx(&d, &s, &p);
|
||||
cx.smart_guides = false;
|
||||
cx.constrain_angle = 30.0;
|
||||
let mut t = FamilyTool::new("arc");
|
||||
t.pointer(&cx, &PointerEvent::new(PointerKind::Down, 10.0, 10.0));
|
||||
let out = t.pointer(&cx, &PointerEvent::new(PointerKind::Drag, 70.0, 30.0).with_mods(shift));
|
||||
let expected = t.command_at(Point::new(10.0, 10.0), Point::new(70.0, 30.0), shift, 30.0);
|
||||
assert_eq!(out, vec![Action::Begin("Arc".into()), Action::Preview(expected.0, expected.1.clone())]);
|
||||
let preview = |a: Vec<Action>| match &a[..] {
|
||||
[Action::Preview(c, v)] if c == "shape.arc" => v.clone(),
|
||||
_ => panic!("{a:?}"),
|
||||
};
|
||||
let v = preview(t.key(&cx, ToolKey::Letter('f'), Mods::default()));
|
||||
assert_eq!(v["baseAlong"], json!("y"));
|
||||
let v = preview(t.key(&cx, ToolKey::Letter('c'), Mods::default()));
|
||||
assert_eq!(v["closed"], json!(true));
|
||||
let v = preview(t.key(&cx, ToolKey::Up, Mods::default()));
|
||||
assert_eq!(v["slope"], json!(60.0));
|
||||
for k in ["x", "y", "lengthX", "lengthY", "rotation"] {
|
||||
assert_eq!(v[k], expected.1[k], "{k} stays");
|
||||
}
|
||||
}
|
||||
|
||||
/// The start and the dragged corner snap to Smart Guides (#506), Shift sliding the corner of
|
||||
/// a square grid along its diagonal into line.
|
||||
#[test]
|
||||
|
||||
+2
-2
@@ -488,8 +488,8 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi
|
||||
Until a choice is made (`default`), the panels follow General › Transform Pattern Tiles as before, and the menu
|
||||
checks Transform Both while it is on and Transform Object Only while it is off; a choice overrides it.
|
||||
Estimate unchanged.
|
||||
- **Done (2026-10-21, #394):** General › Constrain Angle turns the arrow keys' axes (guides stay on the page's), holds Shift drags of the Selection, Direct Selection, Free Transform, Slice Selection, Reshape and Measure tools and the Pen's handles to the turned axes, and new rectangles, rounded rectangles, ellipses, grids, point and area type, Shift-drawn polygons and stars and the shape size dialogs are drawn along it with their bounding box turned; 0° and whole turns are exactly as before, quarter turns exact (<https://helpx.adobe.com/illustrator/desktop/manage-objects/arrange-objects/rotate-objects-by-specific-angles.html>). Arcs, spirals, flares and the Pen's new paths are not turned yet. Estimate unchanged.
|
||||
- **Done (2026-10-21, #394):** General › Constrain Angle turns the arrow keys' axes (guides stay on the page's), holds Shift drags of the Selection, Direct Selection, Free Transform, Slice Selection, Reshape and Measure tools and the Pen's handles to the turned axes, and new rectangles, rounded rectangles, ellipses, grids, point and area type, Shift-drawn polygons and stars and the shape size dialogs are drawn along it with their bounding box turned; 0° and whole turns are exactly as before, quarter turns exact (<https://helpx.adobe.com/illustrator/desktop/manage-objects/arrange-objects/rotate-objects-by-specific-angles.html>). Arcs, spirals, flares and the Pen's new paths are not turned yet. Estimate unchanged. **2026-10-24:** General › Corner Radius is the Rounded Rectangle tool's radius: the tool takes the preference when chosen and when it changes while the tool is active (or lent a selection tool for a drag), and the radius ↑/↓ set while drawing one, or a Tool Options value, becomes the preference, clamped to its 0–1296 pt range (<https://helpx.adobe.com/illustrator/using/drawing-simple-lines-shapes.html>). Estimate unchanged.
|
||||
- **Done (2026-10-21, #394):** General › Constrain Angle turns the arrow keys' axes (guides stay on the page's), holds Shift drags of the Selection, Direct Selection, Free Transform, Slice Selection, Reshape and Measure tools and the Pen's handles to the turned axes, and new rectangles, rounded rectangles, ellipses, grids, point and area type, Shift-drawn polygons and stars and the shape size dialogs are drawn along it with their bounding box turned; 0° and whole turns are exactly as before, quarter turns exact (<https://helpx.adobe.com/illustrator/desktop/manage-objects/arrange-objects/rotate-objects-by-specific-angles.html>). Spirals, flares and the Pen's new paths are not turned yet. Estimate unchanged.
|
||||
- **Done (2026-10-21, #394):** General › Constrain Angle turns the arrow keys' axes (guides stay on the page's), holds Shift drags of the Selection, Direct Selection, Free Transform, Slice Selection, Reshape and Measure tools and the Pen's handles to the turned axes, and new rectangles, rounded rectangles, ellipses, grids, point and area type, Shift-drawn polygons and stars and the shape size dialogs are drawn along it with their bounding box turned; 0° and whole turns are exactly as before, quarter turns exact (<https://helpx.adobe.com/illustrator/desktop/manage-objects/arrange-objects/rotate-objects-by-specific-angles.html>). Spirals, flares and the Pen's new paths are not turned yet. Estimate unchanged. **2026-10-24:** General › Corner Radius is the Rounded Rectangle tool's radius: the tool takes the preference when chosen and when it changes while the tool is active (or lent a selection tool for a drag), and the radius ↑/↓ set while drawing one, or a Tool Options value, becomes the preference, clamped to its 0–1296 pt range (<https://helpx.adobe.com/illustrator/using/drawing-simple-lines-shapes.html>). Estimate unchanged.
|
||||
- **Done (2026-10-17):** Background Export shows its progress in a dialog with Cancel and Continue in Background (#2564), on the shared cancel token (#2546); a cancelled export writes no file. Save As, Export for Screens and Export Selection don't show it yet. Estimate unchanged. **2026-11-06:** opening a file that takes longer than 0.4 s shows a progress window too, with a moving bar, Cancel and Continue in Background (part of #5930); Save and Place still show only the status bar's spinner. Estimate unchanged.
|
||||
- **Done:** quick Image Trace presets trace at once and leave the panel as it was; the Image Trace button (Control bar, Properties) opens the controls with Threshold and Advanced (Paths, Corners, Noise), as the public documentation describes (<https://helpx.adobe.com/illustrator/using/image-trace-results-optimization.html>). Other context-specific Properties gaps remain.
|
||||
- **Done (2026-10-31, #394):** Units › East Asian Type is read, and Q and Ha are units. 1 Q and 1 Ha are each a
|
||||
|
||||
@@ -761,6 +761,13 @@ dragged, headless `press_key` `c` chooses the tool bound to C (headless has no b
|
||||
from the typed letter, so with nothing being dragged `c` and `f` do not run their shortcuts there. Use `select_tool` or
|
||||
`invoke_menu` instead.
|
||||
|
||||
With General › Constrain Angle (`prefs.set {key: "constrainAngle"}`) other than 0° or a whole turn, the Arc tool's drag
|
||||
and its click dialog draw the arc along the turned x and y axes: the drag sends `shape.arc` with `lengthX` and `lengthY`
|
||||
measured along those axes, the reference point `x`, `y` at the drag's corner or the click, and a `rotation` of the
|
||||
Constrain Angle's negative. `shape.arc` takes `rotation` in degrees clockwise on the page, about `x1`, `y1` or about the
|
||||
reference point `x`, `y`; the arc's bounding box turns with it. Without `rotation`, or at 0° or a whole turn, the arc is
|
||||
upright, and a `rotation` that is not a number is an error that adds nothing.
|
||||
|
||||
While a spiral is being dragged out with the Spiral tool, a `drag` event with `mods.alt` or `mods.cmd` keeps the
|
||||
spiral's inner end at the distance from the center it had on the first modified `drag` event, and the outer end follows
|
||||
the pointer. With `mods.alt` alone, dragging outward adds whole winds of four segments and dragging inward removes
|
||||
|
||||
@@ -666,7 +666,9 @@ since 2026-10-01.
|
||||
- **PDF writes a warped image once:** with downsampling on, the pieces of an image bent by a Warp effect are resampled for the widest and the highest size any piece places the image at, so every piece paints one image XObject (a colorized image: one colorized image and its soft mask), instead of one image for each size a piece is placed at. Another placement of the same image is still resampled for its own size. Without downsampling, a colorized image and a CMYK image with a grayscale image mask on its grid are decoded and encoded once for all the sizes they are placed at (pdf `tests::compression::a_warped_image_is_written_once_for_all_its_pieces`, `tests::colorize::a_colorized_warped_image_is_written_once_for_all_its_pieces`, `export::images::tests::colorized_and_grid_masked_images_are_made_once_for_every_size_without_downsampling`). Scores and hours unchanged.
|
||||
- **Distort Appearance with Transform effect options:** with Envelope Options › Distort Appearance on, a path whose Transform effect has Scale Strokes & Effects or Transform Patterns on, or copies it with a gradient, is bent as the same per-copy art it draws and expands as outside the envelope: each copy's own stroke weight, dashes, pattern placement and gradient (effects `bake::tests`). Scores and hours unchanged.
|
||||
- **Fitted gradients turn with the Transform effect:** a gradient fitted to the object (not placed with the Gradient tool) turns, reflects and stretches with the object when its Transform effect rotates, reflects or scales it unevenly, as Object › Transform already does: the gradient is fixed to its fit on the geometry the effect takes, then follows the effect and the effects after it as a placed gradient does. Under moves and even scales it draws as a refit does, and a Transform effect that scales the object to nothing across leaves it fitted, with Scale Strokes & Effects or Transform Patterns on too, and on each copy. This holds on the canvas and in Object › Expand of the fill, for an object's own effects, a fill's or stroke's own, and a group's, where the gradients fitted to its paths, to its own fill, to the groups inside it and to its images' and symbol instances' own fills each fix to their own object's fit. Existing documents with such a Transform effect on fitted-gradient art draw differently: before, the gradient refit to the turned outline. The Gradient tool still shows a fitted gradient's vector at its unturned fit. How gradients follow the effect is VectorCraft's own rule; what the effect does to the object is described in [Distort and transform effects](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/distort-and-transform-effects-in-illustrator.html) (effects `bake::tests::a_fitted_gradient_turns_reflects_and_stretches_with_a_transform_effect`, `bake::tests::a_transform_effect_that_scales_to_nothing_leaves_a_fitted_gradient_fitted`, `group::tests::a_groups_transform_turns_the_gradients_fitted_to_its_members_and_its_own_fill`; render `objectfx::a_fitted_gradient_turns_and_reflects_with_its_transform_on_the_canvas`; engine `objexpand::a_fitted_gradient_turned_by_a_transform_expands_as_the_canvas_draws_it`). Scores and hours unchanged.
|
||||
- **Placed gradients follow Transform and Free Distort effects:** a gradient placed with the Gradient tool moves, turns and scales with the object when the object's Transform effect moves its outline, and each copy of the Transform effect takes it as many times as it takes the transform. Under Free Distort it moves and scales from the path's bounds before the effect to its bounds after it. This holds on the canvas, in export, in Expand Appearance, in Pathfinder and compound shapes, and in Object › Expand of the fill, for an object's own effects, a group's (the own fills of the group, of the groups inside it, of a symbol's art, and of the images and symbol instances it moves, included) and a fill's or stroke's own. A gradient on a path inside a group with a Transform effect now moves with the path (#2214 moved only the gradients of type), and so does a gradient on an image's or symbol instance's own fill. When a path keeps its shape because the effect would pass the geometry budget, the group's own gradients stay in place; a hidden path in a layer, which the layer's bounds leave out, does not hold them. A freeform gradient whose points were edited moves its points in the same way. How gradients follow each effect is VectorCraft's own rule; what each effect does to the object is described in [Distort and transform effects](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/distort-and-transform-effects-in-illustrator.html) (effects `bake::tests::a_baked_transform_moves_a_placed_gradient_with_the_path`, `bake::tests::a_strokes_own_transform_and_free_distort_move_its_placed_gradient`, `bake::tests::a_fills_gradient_follows_the_effects_around_its_transform_with_options`, `bake::tests::baked_free_distort_moves_placed_gradients_from_the_bounds_to_the_distorted_bounds`, `group::tests::a_groups_transform_and_free_distort_move_the_gradients_placed_on_its_paths`, `group::tests::a_groups_transform_moves_the_gradient_of_its_own_fill`, `group::tests::a_nested_groups_own_gradient_follows_the_outer_groups_transform_and_free_distort`, `group::tests::a_groups_transform_moves_the_gradients_placed_on_an_images_own_fills`, `group::tests::shape_art_moves_gradients_with_a_transform_effect`, `group::tests::shape_art_moves_the_gradient_of_a_symbol_instances_art_with_its_transform`, `tests::art_past_the_budget_keeps_its_own_gradients_in_place`, `tests::a_hidden_path_past_the_budget_leaves_a_layers_gradients_free_to_move`, `tests::edited_freeform_points_follow_a_transform_effect_and_free_distort`; render `objectfx::a_paths_gradient_moves_with_its_transform_and_free_distort`; engine `objexpand::a_placed_gradient_moved_by_a_transform_or_free_distort_expands_as_the_canvas_draws_it`). Scores and hours unchanged.- **Constrain Angle (#394):** General › Constrain Angle turns the arrow keys' axes (guides stay on the page's), holds Shift drags of the Selection, Direct Selection, Free Transform, Slice Selection, Reshape and Measure tools and the Pen's handles to the turned axes, and new rectangles, rounded rectangles, ellipses, grids, point and area type, Shift-drawn polygons and stars and the shape size dialogs are drawn along it with their bounding box turned; 0° and whole turns are exactly as before, quarter turns exact (<https://helpx.adobe.com/illustrator/desktop/manage-objects/arrange-objects/rotate-objects-by-specific-angles.html>). Tests: `tests_constrain_tools`, `tests_constrain_new` (engine), `geom` `constrain_axes` / `rotate_deg`, the shape, grid and type tool tests.
|
||||
- **Placed gradients follow Transform and Free Distort effects:** a gradient placed with the Gradient tool moves, turns and scales with the object when the object's Transform effect moves its outline, and each copy of the Transform effect takes it as many times as it takes the transform. Under Free Distort it moves and scales from the path's bounds before the effect to its bounds after it. This holds on the canvas, in export, in Expand Appearance, in Pathfinder and compound shapes, and in Object › Expand of the fill, for an object's own effects, a group's (the own fills of the group, of the groups inside it, of a symbol's art, and of the images and symbol instances it moves, included) and a fill's or stroke's own. A gradient on a path inside a group with a Transform effect now moves with the path (#2214 moved only the gradients of type), and so does a gradient on an image's or symbol instance's own fill. When a path keeps its shape because the effect would pass the geometry budget, the group's own gradients stay in place; a hidden path in a layer, which the layer's bounds leave out, does not hold them. A freeform gradient whose points were edited moves its points in the same way. How gradients follow each effect is VectorCraft's own rule; what each effect does to the object is described in [Distort and transform effects](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/distort-and-transform-effects-in-illustrator.html) (effects `bake::tests::a_baked_transform_moves_a_placed_gradient_with_the_path`, `bake::tests::a_strokes_own_transform_and_free_distort_move_its_placed_gradient`, `bake::tests::a_fills_gradient_follows_the_effects_around_its_transform_with_options`, `bake::tests::baked_free_distort_moves_placed_gradients_from_the_bounds_to_the_distorted_bounds`, `group::tests::a_groups_transform_and_free_distort_move_the_gradients_placed_on_its_paths`, `group::tests::a_groups_transform_moves_the_gradient_of_its_own_fill`, `group::tests::a_nested_groups_own_gradient_follows_the_outer_groups_transform_and_free_distort`, `group::tests::a_groups_transform_moves_the_gradients_placed_on_an_images_own_fills`, `group::tests::shape_art_moves_gradients_with_a_transform_effect`, `group::tests::shape_art_moves_the_gradient_of_a_symbol_instances_art_with_its_transform`, `tests::art_past_the_budget_keeps_its_own_gradients_in_place`, `tests::a_hidden_path_past_the_budget_leaves_a_layers_gradients_free_to_move`, `tests::edited_freeform_points_follow_a_transform_effect_and_free_distort`; render `objectfx::a_paths_gradient_moves_with_its_transform_and_free_distort`; engine `objexpand::a_placed_gradient_moved_by_a_transform_or_free_distort_expands_as_the_canvas_draws_it`). Scores and hours unchanged.
|
||||
- **Constrain Angle (#394):** General › Constrain Angle turns the arrow keys' axes (guides stay on the page's), holds Shift drags of the Selection, Direct Selection, Free Transform, Slice Selection, Reshape and Measure tools and the Pen's handles to the turned axes, and new rectangles, rounded rectangles, ellipses, grids, point and area type, Shift-drawn polygons and stars and the shape size dialogs are drawn along it with their bounding box turned; 0° and whole turns are exactly as before, quarter turns exact (<https://helpx.adobe.com/illustrator/desktop/manage-objects/arrange-objects/rotate-objects-by-specific-angles.html>). Tests: `tests_constrain_tools`, `tests_constrain_new` (engine), `geom` `constrain_axes` / `rotate_deg`, the shape, grid and type tool tests.
|
||||
- **Arcs along General › Constrain Angle:** with a Constrain Angle other than 0° or a whole turn, an arc dragged out with the Arc tool and an arc placed from the Arc Segment Tool Options click dialog are drawn along the turned x and y axes, with their bounding box turned. The drag's box and Shift's equal lengths are measured along those axes, the reference point stays at the drag's corner or at the click, and F, C and ↑/↓ keep the turn. `shape.arc` takes an optional `rotation` (degrees clockwise, about `x1`, `y1` or about the reference point `x`, `y`); a `rotation` that is not a number is an error. At 0° and whole turns arcs are drawn as before, and quarter turns are exact. The help page (<https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=226>) describes new objects being drawn along the turned axes; how the Arc tool's keys and reference point work with them is VectorCraft's own rule (tools `draw2::family::tests::arcs_follow_the_constrain_angle`; engine `constrain_angle_draws_a_dragged_arc_along_the_turned_axes`, `constrain_angle_turns_a_click_made_arc_about_its_reference_point`, `arc_rotation_turns_it_and_must_be_a_number`). Scores and hours unchanged.
|
||||
- **Roughen at Size 0 keeps the outline:** with Size 0 (relative or absolute), Effect › Distort & Transform › Roughen… moves no point: each segment is split at the Detail spacing (fewer points past the anchor limit) into pieces of equal length on the segment itself, so the path keeps its outline, with Smooth or Corner points alike. A straight segment gets corner points without handles, and a curve gets smooth points whose handles follow it. Before, the points were joined by straight lines (Corner) or a smoothed curve through them (Smooth), which changed curved outlines. Existing documents with a Roughen of Size 0 on a curved path, or with Smooth points, draw differently. This is VectorCraft's own rule; what Roughen does is described in [Distort and transform effects](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/distort-and-transform-effects-in-illustrator.html) (effects `tests::roughen_at_size_0_keeps_the_outline_and_spaces_its_points_evenly`). Scores and hours unchanged.
|
||||
|
||||
- **Clipping paths on their outline (G1):** the selection tools (Selection, Direct Selection, Group Selection), Object Highlighting and a right-click take a clipping path on its outline before the art it clips; Select Behind lists the same; the eyedropper, the tools that act on what is drawn and the selection tools' double-clicks, loaded text and guide release take the art. Doc and tool regression tests; score unchanged.
|
||||
|
||||
+1
-1
@@ -468,7 +468,7 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po
|
||||
| DXF export/import preserves intended curve closure | done | #1299; R13–2018 closed SPLINE bit set/read; an open curve ending at its start stays open; knots and control points unchanged; circular cubic paths export as native CIRCLE/ARC where stroke semantics permit; DXF Options' Preset menu and `document.exportDxf`'s `dxfPreset: "cnc"` set the CNC / CAM options (#5500) |
|
||||
| macOS save sheet: choose the format from a menu | done | #866; the save panel is VectorCraft's own `NSSavePanel` with its Format menu set before the sheet opens (`apps/vectorcraft/src/mac_save_format.rs`); #1855 had withdrawn the menu that was added after the sheet began, which made Save As, Save a Copy and the first Save show no sheet |
|
||||
| Preferences: every option acts | partial | 2 stored but unused (#394, audited 2026-10-30): Scratch Disks, Legacy vector clipboard; the rest act (Units › East Asian Type since 2026-10-31; Open Documents As Tabs: cleared, new documents open in floating windows). General › Corner Radius drives the Rounded Rectangle tool and follows its ↑/↓ (2026-10-24) |
|
||||
| Preferences › General › Constrain Angle | done | arrow keys and Shift drags along the turned axes; the Rectangle, Rounded Rectangle, Ellipse and grid tools, point and area type and the shape size dialogs draw along them with the bounding box turned; Shift-drawn polygons and stars keep the turned base orientation; the Line Segment tool's Shift steps count from it (#394, <https://helpx.adobe.com/illustrator/desktop/manage-objects/arrange-objects/rotate-objects-by-specific-angles.html>); arcs, spirals, flares and Pen paths are not turned |
|
||||
| Preferences › General › Constrain Angle | done | arrow keys and Shift drags along the turned axes; the Rectangle, Rounded Rectangle, Ellipse and grid tools, point and area type and the shape size dialogs draw along them with the bounding box turned; Shift-drawn polygons and stars keep the turned base orientation; the Line Segment tool's Shift steps count from it (#394, <https://helpx.adobe.com/illustrator/desktop/manage-objects/arrange-objects/rotate-objects-by-specific-angles.html>); spirals, flares and Pen paths are not turned |
|
||||
| Tabs panel: a stop drags from where the press landed, a stop just added included | done | #1458 |
|
||||
| Outline view keeps template layers in Preview, dimmed | done | #1486; a picture placed to be traced stays visible under the outlines |
|
||||
| Outline view draws on a white canvas, the artboards as their edges | done | Outline shows only the paths ([Outline mode](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/preview-artwork-as-outlines.html)). VectorCraft's own rule for the canvas: in every interface brightness and Canvas Color the whole canvas is white, pasteboard included; the artboards draw no paper (no Simulate Colored Paper or artboard color, and no paper with Hide Artboards); the artboard names and the ruler origin's crosshair are dark gray; split views and floating windows follow their own view. Tests `outline_draws_on_a_white_canvas_with_artboards_as_edges`, `outline_draws_no_colored_paper`, `a_pane_draws_its_own_views_outline`, `the_ruler_origin_crosshair_shows_on_the_outline_canvas` |
|
||||
|
||||
Reference in New Issue
Block a user