mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-17 21:27:00 +00:00
Merge pull request #8108 from dotCooCoo/feat/spiral-constrain-angle
Spiral: dragging turns the spiral to the pointer, and the click dialog starts it along Constrain Angle
This commit is contained in:
@@ -67,7 +67,15 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
circle_through_points
|
||||
),
|
||||
cmd!("shape.line", "Line Segment", [], None, "{x1, y1, x2, y2, fill?: bool (Fill Line: the current fill, else none)} → {id}", has_doc, line),
|
||||
cmd!("shape.spiral", "Spiral", [], None, "{cx, cy, radius, decay=80 (%), segments=10, clockwise?} → {id}", has_doc, spiral),
|
||||
cmd!(
|
||||
"shape.spiral",
|
||||
"Spiral",
|
||||
[],
|
||||
None,
|
||||
"{cx, cy, radius, decay=80 (%), segments=10, clockwise?, rotation?: deg clockwise about (cx, cy)} (0: outer end at (cx + radius, cy)) → {id}",
|
||||
has_doc,
|
||||
spiral
|
||||
),
|
||||
cmd!(
|
||||
"shape.arc",
|
||||
"Arc",
|
||||
@@ -125,13 +133,6 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
]
|
||||
}
|
||||
|
||||
/// Insert a new object at the top of the insertion parent with the current paint and new-art
|
||||
/// template; select it.
|
||||
pub(crate) fn add_art(s: &mut Session, label: &str, kind: NodeKind, name: Option<String>) -> Result<Value> {
|
||||
let look = s.new_art_look(s.paint.fill.clone(), s.paint.stroke.clone(), s.paint.stroke_width);
|
||||
add_look(s, label, kind, look, name)
|
||||
}
|
||||
|
||||
/// Insert a new object looking like `look` (drawing modes apply); select it.
|
||||
pub(crate) fn add_look(s: &mut Session, label: &str, kind: NodeKind, look: NewArt, name: Option<String>) -> Result<Value> {
|
||||
insert_look(s, label, kind, look, name, true)
|
||||
@@ -143,7 +144,8 @@ pub(crate) fn insert_look(s: &mut Session, label: &str, kind: NodeKind, look: Ne
|
||||
insert_look_turned(s, label, kind, look, name, select, 0.0, true)
|
||||
}
|
||||
|
||||
/// [`add_art`] for an object made turned by a `rotation` param (degrees, clockwise on the page):
|
||||
/// Insert a new object at the top of the insertion parent with the current paint and new-art
|
||||
/// template, made turned by a `rotation` param (degrees, clockwise on the page), and select it:
|
||||
/// its bounding box turns with it, as after the Rotate tool.
|
||||
fn add_art_turned(s: &mut Session, label: &str, kind: NodeKind, rotation: f64) -> Result<Value> {
|
||||
let look = s.new_art_look(s.paint.fill.clone(), s.paint.stroke.clone(), s.paint.stroke_width);
|
||||
@@ -321,7 +323,7 @@ fn path_kind(path: PathData, live: Option<LiveShape>) -> NodeKind {
|
||||
/// 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; 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
|
||||
/// placed at the click; a polygon, star or spiral 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;
|
||||
@@ -337,7 +339,7 @@ pub fn constrain_click(s: &Session, cmd: &str, mut params: Value, pivot: Point)
|
||||
o.insert("y".into(), json!(c.y - h / 2.0));
|
||||
o.insert("rotation".into(), json!(rotation));
|
||||
}
|
||||
"shape.polygon" | "shape.star" => {
|
||||
"shape.polygon" | "shape.star" | "shape.spiral" => {
|
||||
o.insert("rotation".into(), json!(rotation));
|
||||
}
|
||||
"shape.arc" if o.contains_key("lengthX") || o.contains_key("lengthY") => {
|
||||
@@ -673,6 +675,10 @@ fn line(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
}
|
||||
|
||||
fn spiral(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let rotation = if p.get("rotation").is_some() { f64_req(p, "rotation", "shape.spiral")? } else { 0.0 };
|
||||
if !rotation.is_finite() {
|
||||
return Err(bad("shape.spiral", "rotation must be finite"));
|
||||
}
|
||||
let c = Point::new(f64_req(p, "cx", "shape.spiral")?, f64_req(p, "cy", "shape.spiral")?);
|
||||
let segments = count_or(p, "segments", 10, "shape.spiral")?.clamp(2, 1000) as u32;
|
||||
let path = shapes::spiral(
|
||||
@@ -682,7 +688,15 @@ fn spiral(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
segments,
|
||||
switch_or(p, "clockwise", true, "shape.spiral")?,
|
||||
);
|
||||
add_art(s, "Spiral", path_kind(path, None), None)
|
||||
// The outer end turns clockwise from (cx + radius, cy) about the center; 0 and whole turns
|
||||
// leave the path as it is, and quarter turns are exact.
|
||||
let path = if bbox_turn(rotation) == 0.0 {
|
||||
path
|
||||
} else {
|
||||
let c = c.to_vec2();
|
||||
path.transformed(Affine::translate(c) * vectorcraft_geom::rotate_deg(rotation) * Affine::translate(-c))
|
||||
};
|
||||
add_art_turned(s, "Spiral", path_kind(path, None), constrained_turn(s, rotation))
|
||||
}
|
||||
|
||||
fn arc(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
|
||||
@@ -506,3 +506,92 @@ fn arc_rotation_turns_it_and_must_be_a_number() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The outer end of the spiral `id`.
|
||||
fn spiral_outer_end(s: &Session, id: NodeId) -> Point {
|
||||
*path_points(s, id).last().unwrap()
|
||||
}
|
||||
|
||||
/// A spiral dragged out turns about its center so that its outer end is at the pointer, in every
|
||||
/// direction and with a turned Constrain Angle too; its bounding box stays on the page, except
|
||||
/// along the turned x axis, where it is the click dialog's spiral with its turned box.
|
||||
#[test]
|
||||
fn a_dragged_spiral_turns_its_outer_end_to_the_pointer() {
|
||||
let mut s = new_doc();
|
||||
for deg in [0.0, 30.0] {
|
||||
set_angle(&mut s, deg);
|
||||
s.select_tool("spiral", ViewInfo::default()).unwrap();
|
||||
for (x, y) in [(260.0, 200.0), (200.0, 260.0), (140.0, 200.0), (200.0, 140.0), (240.0, 170.0)] {
|
||||
gesture(&mut s, Mods::default(), &[(Down, 200.0, 200.0), (Drag, 230.0, 230.0), (Drag, x, y), (Up, x, y)]);
|
||||
let id = last_id(&s);
|
||||
let end = spiral_outer_end(&s, id);
|
||||
assert!(near(end, x, y), "{deg}°, to ({x}, {y}): {end:?}");
|
||||
assert_eq!(bbox_angle(&s, id).to_bits(), 0.0f64.to_bits(), "{deg}°, to ({x}, {y})");
|
||||
}
|
||||
}
|
||||
let mut s = new_doc();
|
||||
set_angle(&mut s, 90.0);
|
||||
s.select_tool("spiral", ViewInfo::default()).unwrap();
|
||||
gesture(&mut s, Mods::default(), &[(Down, 200.0, 200.0), (Drag, 230.0, 230.0), (Drag, 200.0, 150.0), (Up, 200.0, 150.0)]);
|
||||
let id = last_id(&s);
|
||||
assert_eq!(spiral_outer_end(&s, id), Point::new(200.0, 150.0));
|
||||
assert_eq!(bbox_angle(&s, id), 90.0, "along the turned x axis");
|
||||
}
|
||||
|
||||
/// A spiral placed by the click dialog starts along the turned x axis, about the click: at 90° its
|
||||
/// outer end is straight above the center, exactly, and its bounding box turns with it; at 0°, a
|
||||
/// whole turn and with a `rotation` given the dialog's params are unchanged.
|
||||
#[test]
|
||||
fn constrain_angle_turns_a_click_made_spiral() {
|
||||
let mut s = new_doc();
|
||||
let click = Point::new(200.0, 200.0);
|
||||
let p = json!({"cx": 200.0, "cy": 200.0, "radius": 50.0, "decay": 80.0, "segments": 10, "clockwise": true});
|
||||
assert_eq!(constrain_click(&s, "shape.spiral", p.clone(), click), p, "0°");
|
||||
set_angle(&mut s, 360.0);
|
||||
assert_eq!(constrain_click(&s, "shape.spiral", p.clone(), click), p, "a whole turn");
|
||||
set_angle(&mut s, 90.0);
|
||||
let mut given = p.clone();
|
||||
given["rotation"] = json!(10.0);
|
||||
assert_eq!(constrain_click(&s, "shape.spiral", given.clone(), click), given, "a given rotation");
|
||||
let turned = constrain_click(&s, "shape.spiral", p.clone(), click);
|
||||
assert_eq!(turned["rotation"], json!(-90.0));
|
||||
let id = NodeId(s.execute("shape.spiral", &turned).unwrap()["id"].as_u64().unwrap());
|
||||
assert_eq!(spiral_outer_end(&s, id), Point::new(200.0, 150.0));
|
||||
assert_eq!(bbox_angle(&s, id), 90.0);
|
||||
set_angle(&mut s, 30.0);
|
||||
let id = NodeId(s.execute("shape.spiral", &constrain_click(&s, "shape.spiral", p, click)).unwrap()["id"].as_u64().unwrap());
|
||||
let r = 30f64.to_radians();
|
||||
let end = spiral_outer_end(&s, id);
|
||||
assert!(near(end, 200.0 + 50.0 * r.cos(), 200.0 - 50.0 * r.sin()), "{end:?}");
|
||||
assert!(close(bbox_angle(&s, id), 30.0), "{}", bbox_angle(&s, id));
|
||||
}
|
||||
|
||||
/// `shape.spiral` turns by an explicit `rotation` (clockwise) about its center; 0 and a whole
|
||||
/// turn draw it exactly as without one; a `rotation` that is not a number is refused and adds
|
||||
/// nothing.
|
||||
#[test]
|
||||
fn spiral_rotation_turns_it_and_must_be_a_number() {
|
||||
let mut s = new_doc();
|
||||
let base = json!({"cx": 100, "cy": 100, "radius": 40, "segments": 6});
|
||||
let with = |r: Value| {
|
||||
let mut p = base.clone();
|
||||
p["rotation"] = r;
|
||||
p
|
||||
};
|
||||
let plain = NodeId(s.execute("shape.spiral", &base).unwrap()["id"].as_u64().unwrap());
|
||||
let plain = path_points(&s, plain);
|
||||
assert_eq!(*plain.last().unwrap(), Point::new(140.0, 100.0), "upright: the outer end to the right");
|
||||
for r in [json!(0), json!(360)] {
|
||||
let id = NodeId(s.execute("shape.spiral", &with(r.clone())).unwrap()["id"].as_u64().unwrap());
|
||||
assert_eq!(path_points(&s, id), plain, "{r}");
|
||||
assert_eq!(bbox_angle(&s, id).to_bits(), 0.0f64.to_bits(), "{r}");
|
||||
}
|
||||
let id = NodeId(s.execute("shape.spiral", &with(json!(90))).unwrap()["id"].as_u64().unwrap());
|
||||
assert_eq!(spiral_outer_end(&s, id), Point::new(100.0, 140.0), "a quarter turn clockwise");
|
||||
assert_eq!(bbox_angle(&s, id).to_bits(), 0.0f64.to_bits(), "not the Constrain Angle's turn");
|
||||
for bad in [json!("x"), Value::Null, json!(true)] {
|
||||
let p = with(bad);
|
||||
assert!(s.execute("shape.spiral", &p).is_err(), "{p}");
|
||||
assert_eq!(last_id(&s), id, "nothing added for {p}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
//! start point and the dragged corner snap to Smart Guides ([`DrawSnap`]), hovering too.
|
||||
//! While dragging, ↑/↓ change the arc's slope, the spiral's segments, the grid rows or the
|
||||
//! concentric dividers; ←/→ change grid columns / radial dividers. C switches the arc between open
|
||||
//! and closed, and F switches its base between the X and Y axes. While a spiral is dragged out, Alt
|
||||
//! and closed, and F switches its base between the X and Y axes. A spiral's outer end follows the
|
||||
//! pointer, so dragging around the center turns the spiral. While a spiral is dragged out, Alt
|
||||
//! and Ctrl/Cmd keep its inner end at the distance from the center on the first modified drag as
|
||||
//! the outer end follows the pointer: Alt adds or removes whole winds of four segments, and
|
||||
//! Ctrl/Cmd changes the decay.
|
||||
@@ -48,6 +49,9 @@ pub struct FamilyTool {
|
||||
spiral_end: Option<f64>,
|
||||
/// The segment count when Alt alone starts adjusting winds.
|
||||
spiral_alt_base: Option<u32>,
|
||||
/// The direction (degrees clockwise on the page from the x axis) of the drag's last pointer at
|
||||
/// least 0.01 pt from the center, 0 before there is one: the spiral's outer end turns to it.
|
||||
spiral_bearing: f64,
|
||||
/// Rows / concentric dividers.
|
||||
pub rows: u32,
|
||||
/// Columns / radial dividers.
|
||||
@@ -108,6 +112,7 @@ impl FamilyTool {
|
||||
clockwise: true,
|
||||
spiral_end: None,
|
||||
spiral_alt_base: None,
|
||||
spiral_bearing: 0.0,
|
||||
rows: 5,
|
||||
columns: 5,
|
||||
skew: [0.0; 2],
|
||||
@@ -202,6 +207,13 @@ impl FamilyTool {
|
||||
}
|
||||
}
|
||||
|
||||
/// The direction (degrees clockwise on the page from the x axis) from a spiral's center `start`
|
||||
/// to the pointer `p`, or the last one when `p` is less than 0.01 pt from the center.
|
||||
fn spiral_bearing_to(&self, start: Point, p: Point) -> f64 {
|
||||
let d = p - start;
|
||||
if d.hypot() >= 0.01 { d.y.atan2(d.x).to_degrees() } else { self.spiral_bearing }
|
||||
}
|
||||
|
||||
/// The skew a letter changes while a grid is dragged out, as an index into `skew`, and the
|
||||
/// direction: F lowers and V raises the skew of the horizontal dividers (a rectangular grid's
|
||||
/// rows) or the radial dividers (a polar grid's), X lowers and C raises that of the vertical
|
||||
@@ -244,12 +256,16 @@ impl FamilyTool {
|
||||
/// 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 {
|
||||
// The spiral: its outer end at the pointer, turned about the center.
|
||||
"spiral" => {
|
||||
let r = p.distance(start).max(0.01);
|
||||
(
|
||||
"shape.spiral".into(),
|
||||
json!({"cx": start.x, "cy": start.y, "radius": r, "decay": self.decay, "segments": self.segments, "clockwise": self.clockwise}),
|
||||
)
|
||||
let mut params =
|
||||
json!({"cx": start.x, "cy": start.y, "radius": r, "decay": self.decay, "segments": self.segments, "clockwise": self.clockwise});
|
||||
let rotation = self.spiral_bearing_to(start, p);
|
||||
if rotation != 0.0 {
|
||||
params["rotation"] = json!(rotation);
|
||||
}
|
||||
("shape.spiral".into(), params)
|
||||
}
|
||||
// The grids: the dragged box (along the Constrain Angle's axes) with the tool's options.
|
||||
"rectangularGrid" | "polarGrid" => {
|
||||
@@ -308,6 +324,7 @@ impl Tool for FamilyTool {
|
||||
self.began = false;
|
||||
self.spiral_end = None;
|
||||
self.spiral_alt_base = None;
|
||||
self.spiral_bearing = 0.0;
|
||||
self.before_drag = None;
|
||||
vec![]
|
||||
}
|
||||
@@ -329,6 +346,7 @@ impl Tool for FamilyTool {
|
||||
}
|
||||
if self.id == "spiral" {
|
||||
self.hold_spiral_end(s, ev.pos, ev.mods);
|
||||
self.spiral_bearing = self.spiral_bearing_to(s, ev.pos);
|
||||
}
|
||||
let (c, v) = self.command_at(s, ev.pos, ev.mods, cx.constrain_angle);
|
||||
out.push(Action::Preview(c, v));
|
||||
@@ -982,6 +1000,43 @@ mod tests {
|
||||
assert_eq!(t.spiral_alt_base, None, "Up after Down clears the Alt base");
|
||||
}
|
||||
|
||||
/// A spiral dragged out turns to the pointer (`rotation` clockwise from the x axis), none to
|
||||
/// the right as before; a pointer back on the center keeps the last direction, ↑ keeps it,
|
||||
/// Shift and Constrain Angle leave it to the pointer, and the next drag starts from none.
|
||||
#[test]
|
||||
fn spiral_drag_turns_the_spiral_to_the_pointer() {
|
||||
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 preview = |a: Vec<Action>| match &a[..] {
|
||||
[.., Action::Preview(c, v)] if c == "shape.spiral" => v.clone(),
|
||||
_ => panic!("{a:?}"),
|
||||
};
|
||||
let shift = Mods { shift: true, ..Mods::default() };
|
||||
let mut t = FamilyTool::new("spiral");
|
||||
t.pointer(&cx, &PointerEvent::new(PointerKind::Down, 100.0, 100.0));
|
||||
let v = preview(t.pointer(&cx, &PointerEvent::new(PointerKind::Drag, 150.0, 100.0)));
|
||||
assert!(v.get("rotation").is_none(), "to the right: {v}");
|
||||
assert_eq!(v["radius"], json!(50.0));
|
||||
for ((x, y), rotation) in [((100.0, 150.0), 90.0), ((50.0, 100.0), 180.0), ((100.0, 50.0), -90.0), ((130.0, 130.0), 45.0)] {
|
||||
let v = preview(t.pointer(&cx, &PointerEvent::new(PointerKind::Drag, x, y).with_mods(shift)));
|
||||
assert!((v["rotation"].as_f64().unwrap() - rotation).abs() < 1e-9, "to ({x}, {y}): {v}");
|
||||
}
|
||||
let v = preview(t.pointer(&cx, &PointerEvent::new(PointerKind::Drag, 100.0, 100.0)));
|
||||
assert!((v["rotation"].as_f64().unwrap() - 45.0).abs() < 1e-9, "on the center: {v}");
|
||||
assert_eq!(v["radius"], json!(0.01));
|
||||
t.pointer(&cx, &PointerEvent::new(PointerKind::Drag, 100.0, 140.0));
|
||||
let v = preview(t.key(&cx, ToolKey::Up, Mods::default()));
|
||||
assert!((v["rotation"].as_f64().unwrap() - 90.0).abs() < 1e-9, "after ↑: {v}");
|
||||
assert_eq!(v["segments"], json!(11));
|
||||
assert_eq!(t.pointer(&cx, &PointerEvent::new(PointerKind::Up, 100.0, 140.0)), vec![Action::Commit]);
|
||||
t.pointer(&cx, &PointerEvent::new(PointerKind::Down, 100.0, 100.0));
|
||||
assert_eq!(t.spiral_bearing, 0.0, "a new drag starts from none");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn arc_drag_uses_stored_segment_options() {
|
||||
let mut t = FamilyTool::new("arc");
|
||||
|
||||
@@ -709,6 +709,26 @@ mod tests {
|
||||
assert_eq!(app.session.tool_options_of("spiral"), json!({"decay": 65.0, "segments": 12, "clockwise": true}));
|
||||
}
|
||||
|
||||
/// With General › Constrain Angle at 90°, the Spiral dialog's spiral starts straight up from the
|
||||
/// click, and the tool's options keep no turn.
|
||||
#[test]
|
||||
fn spiral_click_dialog_starts_along_the_constrain_angle() {
|
||||
let mut app = VectorcraftApp::new(Session::new(), Default::default());
|
||||
app.run("file.new", json!({"width": 300, "height": 200})).unwrap();
|
||||
app.run("prefs.set", json!({"key": "constrainAngle", "value": 90})).unwrap();
|
||||
app.run("tool.select", json!({"tool": "spiral"})).unwrap();
|
||||
super::super::open_tool_dialog(&mut app, "spiral", json!({"x": 40.0, "y": 60.0}));
|
||||
app.ui.dialog.as_mut().expect("Spiral dialog").fields.insert("radius".into(), json!(35.0));
|
||||
super::super::confirm(&mut app).unwrap();
|
||||
|
||||
let st = app.session.doc().unwrap();
|
||||
let id = *st.selection.objects.first().unwrap();
|
||||
let path = st.doc.node(id).unwrap().path_data().unwrap();
|
||||
let outer = path.subpaths[0].anchors.last().unwrap().p;
|
||||
assert_eq!(outer, vectorcraft_geom::Point::new(40.0, 25.0));
|
||||
assert!(app.session.tool_options_of("spiral").get("rotation").is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn alt_click_centres_the_typed_size_on_the_click() {
|
||||
let fields = |alt: bool| Dialog::new("rectangle", json!({"x": 100.0, "y": 50.0, "alt": alt, "width": "40 pt", "height": "20 pt"}));
|
||||
|
||||
+2
-2
@@ -490,8 +490,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>). 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-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>). 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>). 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
|
||||
|
||||
+11
@@ -769,6 +769,17 @@ Constrain Angle's negative. `shape.arc` takes `rotation` in degrees clockwise on
|
||||
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.
|
||||
|
||||
A Spiral tool drag sends `shape.spiral` with the spiral's outer end at the pointer: `radius` is the pointer's distance
|
||||
from the center `cx`, `cy` and `rotation` its direction in degrees clockwise on the page from the x axis, left out when
|
||||
it is 0, so dragging around the center turns the spiral. A pointer less than 0.01 pt from the center keeps the last
|
||||
direction (none before the first). Shift and General › Constrain Angle do not change a dragged spiral's direction. The
|
||||
Spiral dialog's spiral, placed by a click, takes a `rotation` of the Constrain Angle's negative when the angle is other
|
||||
than 0° or a whole turn, so its outer end starts along the turned x axis, and its bounding box turns with it.
|
||||
`shape.spiral` takes `rotation` in degrees clockwise about `cx`, `cy`; without it, or at 0 or a whole turn, the outer
|
||||
end is at `cx + radius`, `cy` as before, and a `rotation` that is not a number is an error that adds nothing. The
|
||||
bounding box turns only when `rotation` is the Constrain Angle's negative, as for `shape.polygon` and `shape.star`, so a
|
||||
drag that points along the turned x axis makes the same spiral, with the same turned box, as the dialog.
|
||||
|
||||
`shape.arc` checks `reference`, `baseAlong` and `slope` in both of its forms. `reference` is a whole number from 0 to 8
|
||||
(`4.0` is 4) and is 0 when left out; `baseAlong` is `x` or `y` in either case and is `x` when left out; `slope` is
|
||||
from −100 to 100 and is 50 when left out with `lengthX` and `lengthY`, or 100 with `x1`, `y1`, `x2`, `y2`. A
|
||||
|
||||
@@ -684,6 +684,7 @@ since 2026-10-01.
|
||||
- **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.
|
||||
- **Spirals turn as they are dragged, and along General › Constrain Angle:** a spiral dragged out with the Spiral tool turns about its center so that its outer end is at the pointer, so dragging around the center turns it, while Alt, Ctrl/Cmd, ↑/↓, Space and Escape work as before. A spiral placed from the Spiral dialog starts along the x axis turned by a Constrain Angle other than 0° or a whole turn, with its bounding box turned. `shape.spiral` takes an optional `rotation` (degrees clockwise about `cx`, `cy`); a `rotation` that is not a number is an error, and without one spirals are drawn as before. The help page (<https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=65>) says that moving the pointer around in a curve during the drag turns the new spiral, and 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. Putting the outer end exactly at the pointer, keeping the last direction while the pointer is within 0.01 pt of the center, and leaving a dragged spiral's direction to the pointer with Shift or a Constrain Angle are VectorCraft's own rules (tools `draw2::family::tests::spiral_drag_turns_the_spiral_to_the_pointer`; engine `a_dragged_spiral_turns_its_outer_end_to_the_pointer`, `constrain_angle_turns_a_click_made_spiral`, `spiral_rotation_turns_it_and_must_be_a_number`; UI `spiral_click_dialog_starts_along_the_constrain_angle`). Scores and hours unchanged.
|
||||
- **Shape commands refuse invalid options:** `shape.arc` refuses a `reference` that is not a whole number from 0 to 8, a `baseAlong` other than `x` or `y` (either case), null included for both, and a `slope` outside −100…100, in both of its forms; before, such a value drew the arc with reference point 0 or 8, the X axis or the nearest slope. `shape.rectangularGrid` and `shape.polarGrid` refuse a divider count that is not a whole number of at least 0; before, such a count was 5. Each error names the key, and nothing is drawn. Left-out values keep their defaults. These ranges are VectorCraft's own command rules (engine `draw2::shape_arc_rejects_an_invalid_reference_base_along_or_slope`, `draw2::shape_arc_takes_every_reference_point_and_either_base_axis`, `draw2::grid_divider_counts_reject_fractions_and_negatives`). Scores and hours unchanged.
|
||||
- **Roughen at Size 0 keeps the outline:** with Size 0 (relative or absolute), Effect › Distort & Transform › Roughen… moves no point: each segment is split at the Detail spacing (fewer points past the anchor limit) into pieces of equal length on the segment itself, so the path keeps its outline, with Smooth or Corner points alike. A straight segment gets corner points without handles, and a curve gets smooth points whose handles follow it. Before, the points were joined by straight lines (Corner) or a smoothed curve through them (Smooth), which changed curved outlines. Existing documents with a Roughen of Size 0 on a curved path, or with Smooth points, draw differently. This is VectorCraft's own rule; what Roughen does is described in [Distort and transform effects](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/distort-and-transform-effects-in-illustrator.html) (effects `tests::roughen_at_size_0_keeps_the_outline_and_spaces_its_points_evenly`). Scores and hours unchanged.
|
||||
|
||||
|
||||
+1
-1
@@ -475,7 +475,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>); 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>); 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