mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-27 16:59:43 +01:00
Live Corners: the Corners pop-up applies its radius after the Stack
The pop-up's Radius edits are now collected inside the Stack and applied after it, as the kind and rounding radios already are. relativeRadii no longer turns a plain path into a Live Corners path here; that change goes to its own pull request. relativeRadii on a plain path, an ellipse or a line leaves it as it is and adds no undo step.
This commit is contained in:
1 parent
c7ae974cf3
commit
281cee4379
7 files changed
+31
-61
No files matched your search
@@ -205,8 +205,8 @@ impl<'a> LiveCorners<'a> {
|
||||
/// Set `radius` (document units; negative: 0) and/or `kind` on the `corners` (anchor indices of
|
||||
/// the uncut outline, see [`LiveCorners`]) of a path and its live shape, then cut the path again.
|
||||
/// A path that isn't a live shape keeps its uncut outline as a [`LiveShape::Path`], which is a
|
||||
/// plain path again once no corner is cut, unless its rounding is Relative. Ellipses and lines
|
||||
/// have no corners: they stay as they are.
|
||||
/// plain path again once no corner is cut. Ellipses and lines have no corners: they stay as they
|
||||
/// are.
|
||||
pub fn set_corners(path: &mut PathData, live: &mut Option<Box<LiveShape>>, corners: &BTreeSet<usize>, radius: Option<f64>, kind: Option<CornerKind>) {
|
||||
fn edit(
|
||||
base: &PathData,
|
||||
@@ -268,8 +268,7 @@ pub fn set_corners(path: &mut PathData, live: &mut Option<Box<LiveShape>>, corne
|
||||
LiveShape::Ellipse { .. } | LiveShape::Line { .. } => return,
|
||||
}
|
||||
match live.as_deref_mut() {
|
||||
// A path with Relative rounding keeps its record, and with it the rounding.
|
||||
Some(LiveShape::Path { base, radii, kinds, radii_relative: false }) if radii.is_empty() && kinds.is_empty() => {
|
||||
Some(LiveShape::Path { base, radii, kinds, .. }) if radii.is_empty() && kinds.is_empty() => {
|
||||
*path = std::mem::take(base);
|
||||
*live = None;
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Live Shape Properties",
|
||||
[],
|
||||
None,
|
||||
"{id?, ids?, radius?: pt (or % of each corner's maximum when `relativeRadii` is true), kind?: \"round\"|\"invertedRound\"|\"chamfer\", relativeRadii?: bool (Relative rounding: store radii as fractions of each corner's maximum so they scale with the shape; it applies to a whole path: a live rectangle, a live polygon or any path with a corner, which keeps its outline as the base of its Live Corners; a path without Live Corners is Absolute, and a path whose anchors are edited loses its Live Corners and is Absolute again; ellipses and lines are left as they are), corners?: [i…], rectanglesOnly?: bool (only the live rectangles among the targets; the other objects stay as they are), items?: [{id, corners?: [i…]}] (several objects, each with its own corners, in place of ids and corners: the canvas's corner widgets across a selection), sides?: n, polygonAngle?: degrees (counter-clockwise from its first vertex straight up), polygonRadius?: pt (centre to vertex), sideLength?: pt (sets the radius), makeSidesEqual?: true (a polygon scaled unevenly: drops the uneven scale and shear, keeping its centre, angle and mean radius), pieStart?, pieEnd?: degrees (an ellipse's pie, counter-clockwise from 3 o'clock; 0 to 360 is the whole ellipse), invertPie?: true (swaps them: the other part of the ellipse), constrainPie?: bool (Constrain Pie Angle: with one of pieStart and pieEnd, not both and not with invertPie, the other angle moves by as much, so each ellipse keeps its span), lineLength?: pt (a live line's length, above 0; its first end stays), lineAngle?: degrees (a live line's angle, counter-clockwise from 3 o'clock, from its first end to its second; it turns about its midpoint), rectangleAngle?: degrees (a live rectangle's, counterclockwise from level), ellipseAngle?: degrees (a live ellipse's, counterclockwise from level; its pie turns with it)} (rectangleAngle, ellipseAngle and polygonAngle turn each shape of that kind about its own center and leave other objects as they are; a pixel-aligned shape then goes back on the pixel grid, as after other edits, which can move its center or change its size; an angle that is not a number is an error, and `null` counts as an omitted key; a shape that a turn would take past the coordinate limit (±4,000,000 pt) is an error that changes nothing; Live Corners on any path: radius and kind set its corners (anchors that aren't smooth, where two sides, straight or curved (#1144), meet at an angle): `corners` (anchor indices of the path with its corners uncut, counting every subpath's anchors in order: a rectangle's 0 top-left, 1 top-right, 2 bottom-right, 3 bottom-left; a polygon's from the first vertex clockwise), else the corners with a Direct-Selected anchor, else every corner; each radius is drawn no larger than half the corner's shorter side allows; a path that isn't a live shape keeps its uncut outline so its corners stay editable, and is plain again once none is cut, unless its rounding is Relative; sides: a polygon's, which keep the radius they shared; the polygon params apply in that order: sides, makeSidesEqual, polygonAngle, then sideLength or else polygonRadius; a line's lineLength applies before its lineAngle)",
|
||||
"{id?, ids?, radius?: pt (or % of each corner's maximum when `relativeRadii` is true), kind?: \"round\"|\"invertedRound\"|\"chamfer\", relativeRadii?: bool (Relative rounding: store radii as fractions of each corner's maximum so they scale with the shape; it applies to a whole live rectangle, live polygon or path with Live Corners; a plain path, an ellipse and a line are left as they are, with no undo step), corners?: [i…], rectanglesOnly?: bool (only the live rectangles among the targets; the other objects stay as they are), items?: [{id, corners?: [i…]}] (several objects, each with its own corners, in place of ids and corners: the canvas's corner widgets across a selection), sides?: n, polygonAngle?: degrees (counter-clockwise from its first vertex straight up), polygonRadius?: pt (centre to vertex), sideLength?: pt (sets the radius), makeSidesEqual?: true (a polygon scaled unevenly: drops the uneven scale and shear, keeping its centre, angle and mean radius), pieStart?, pieEnd?: degrees (an ellipse's pie, counter-clockwise from 3 o'clock; 0 to 360 is the whole ellipse), invertPie?: true (swaps them: the other part of the ellipse), constrainPie?: bool (Constrain Pie Angle: with one of pieStart and pieEnd, not both and not with invertPie, the other angle moves by as much, so each ellipse keeps its span), lineLength?: pt (a live line's length, above 0; its first end stays), lineAngle?: degrees (a live line's angle, counter-clockwise from 3 o'clock, from its first end to its second; it turns about its midpoint), rectangleAngle?: degrees (a live rectangle's, counterclockwise from level), ellipseAngle?: degrees (a live ellipse's, counterclockwise from level; its pie turns with it)} (rectangleAngle, ellipseAngle and polygonAngle turn each shape of that kind about its own center and leave other objects as they are; a pixel-aligned shape then goes back on the pixel grid, as after other edits, which can move its center or change its size; an angle that is not a number is an error, and `null` counts as an omitted key; a shape that a turn would take past the coordinate limit (±4,000,000 pt) is an error that changes nothing; Live Corners on any path: radius and kind set its corners (anchors that aren't smooth, where two sides, straight or curved (#1144), meet at an angle): `corners` (anchor indices of the path with its corners uncut, counting every subpath's anchors in order: a rectangle's 0 top-left, 1 top-right, 2 bottom-right, 3 bottom-left; a polygon's from the first vertex clockwise), else the corners with a Direct-Selected anchor, else every corner; each radius is drawn no larger than half the corner's shorter side allows; a path that isn't a live shape keeps its uncut outline so its corners stay editable, and is plain again once none is cut; sides: a polygon's, which keep the radius they shared; the polygon params apply in that order: sides, makeSidesEqual, polygonAngle, then sideLength or else polygonRadius; a line's lineLength applies before its lineAngle)",
|
||||
has_selection,
|
||||
set_live_shape
|
||||
),
|
||||
|
||||
@@ -99,15 +99,10 @@ fn corners_param(p: &Value) -> Result<Option<BTreeSet<usize>>> {
|
||||
list.iter().map(|k| k.as_u64().and_then(|k| usize::try_from(k).ok()).ok_or_else(err)).collect::<Result<_>>().map(Some)
|
||||
}
|
||||
|
||||
/// Whether `relativeRadii` applies to a path drawn as `path` with live shape `live`: a live
|
||||
/// rectangle, a live polygon, a path with Live Corners, or a plain path with a corner. A plain
|
||||
/// path's rounding is Absolute.
|
||||
fn takes_rounding(path: &PathData, live: Option<&LiveShape>) -> bool {
|
||||
match live {
|
||||
Some(LiveShape::Rectangle { .. } | LiveShape::Polygon { .. } | LiveShape::Path { .. }) => true,
|
||||
Some(LiveShape::Ellipse { .. } | LiveShape::Line { .. }) => false,
|
||||
None => LiveCorners::new(path, None).is_some_and(|c| !c.all().is_empty()),
|
||||
}
|
||||
/// Whether `relativeRadii` applies to a path with live shape `live`: a live rectangle, a live
|
||||
/// polygon or a path with Live Corners. A plain path, an ellipse and a line stay as they are.
|
||||
fn takes_rounding(live: Option<&LiveShape>) -> bool {
|
||||
matches!(live, Some(LiveShape::Rectangle { .. } | LiveShape::Polygon { .. } | LiveShape::Path { .. }))
|
||||
}
|
||||
|
||||
/// Live line `l` with Line Length `len` (its first end stays) and then Line Angle `angle` (about
|
||||
@@ -288,7 +283,7 @@ pub(super) fn set_live_shape(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
Some(l @ LiveShape::Rectangle { .. }) if rectangle_angle.is_some_and(|a| !at_angle(l.shape_angle(), a)) => return false,
|
||||
_ => {}
|
||||
}
|
||||
if relative_radii.is_some_and(|on| takes_rounding(path, live.as_deref()) && live.as_deref().is_some_and(LiveShape::radii_relative) != on) {
|
||||
if relative_radii.is_some_and(|on| takes_rounding(live.as_deref()) && live.as_deref().is_some_and(LiveShape::radii_relative) != on) {
|
||||
return false;
|
||||
}
|
||||
if radius.is_none() && kind.is_none() {
|
||||
@@ -366,23 +361,11 @@ pub(super) fn set_live_shape(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
*l = new.clone();
|
||||
*path = l.to_path();
|
||||
}
|
||||
// A path with corners and no Live Corners yet keeps its outline as their base, so that
|
||||
// Relative rounding has a record to go in.
|
||||
if relative_radii == Some(true) && live.is_none() && takes_rounding(path, None) {
|
||||
*live = Some(Box::new(LiveShape::Path { base: path.clone(), radii: vec![], kinds: vec![], radii_relative: false }));
|
||||
}
|
||||
if let Some(on) = relative_radii
|
||||
&& let Some(l) = live.as_deref_mut()
|
||||
{
|
||||
convert_radii_relative(l, on);
|
||||
*path = l.to_path();
|
||||
// Absolute with no corner cut: a plain path again, as `set_corners` leaves one.
|
||||
if let LiveShape::Path { radii, kinds, radii_relative: false, .. } = l
|
||||
&& radii.is_empty()
|
||||
&& kinds.is_empty()
|
||||
{
|
||||
*live = None;
|
||||
}
|
||||
}
|
||||
if radius.is_none() && kind.is_none() {
|
||||
continue;
|
||||
|
||||
@@ -910,12 +910,10 @@ fn relative_corner_rounding_keeps_fraction_on_resize() {
|
||||
assert!((c.drawn_radius(0) / drawn - 2.0).abs() < 0.05, "drawn radius doubled with the shape");
|
||||
}
|
||||
|
||||
/// Relative rounding on a path with corners and no Live Corners yet takes effect in one undo step,
|
||||
/// a radius set afterwards is stored as a fraction, and the rounding stays when no corner is cut
|
||||
/// any more. Absolute, which such a path already has, and Relative on an ellipse, which has no
|
||||
/// corners, add no undo step.
|
||||
/// `relativeRadii` on a plain path or an ellipse, which have no Live Corners record, leaves them
|
||||
/// as they are and adds no undo step.
|
||||
#[test]
|
||||
fn relative_rounding_takes_on_a_plain_path() {
|
||||
fn relative_rounding_without_live_corners_adds_no_undo_step() {
|
||||
let (mut s, id) = session();
|
||||
s.execute("select.set", &json!({"ids": [id.0]})).unwrap();
|
||||
s.execute("object.expandShape", &json!({})).unwrap();
|
||||
@@ -923,22 +921,9 @@ fn relative_rounding_takes_on_a_plain_path() {
|
||||
let steps = |s: &Session| s.doc().unwrap().history.undo.len();
|
||||
let n = steps(&s);
|
||||
run(&mut s, json!({"ids": [id.0], "relativeRadii": false}));
|
||||
assert_eq!(steps(&s), n, "Absolute: no change");
|
||||
run(&mut s, json!({"ids": [id.0], "relativeRadii": true}));
|
||||
assert_eq!(steps(&s), n + 1, "Relative: one undo step");
|
||||
let node = s.doc().unwrap().doc.node(id).unwrap();
|
||||
assert!(LiveCorners::of(node).unwrap().radii_relative());
|
||||
let max = LiveCorners::of(node).unwrap().corner(0).unwrap().max_radius();
|
||||
run(&mut s, json!({"ids": [id.0], "corners": [0], "radius": max / 2.0}));
|
||||
let c = LiveCorners::of(s.doc().unwrap().doc.node(id).unwrap()).unwrap();
|
||||
assert!(c.radii_relative() && (c.radius(0) - 0.5).abs() < 1e-9, "stored fraction: {}", c.radius(0));
|
||||
// With no corner cut again, the path keeps its Relative rounding.
|
||||
run(&mut s, json!({"ids": [id.0], "corners": [0], "radius": 0}));
|
||||
let c = LiveCorners::of(s.doc().unwrap().doc.node(id).unwrap()).unwrap();
|
||||
assert!(c.radii_relative() && c.radius(0) == 0.0, "still Relative");
|
||||
// Absolute again with no corner cut: a plain path again.
|
||||
run(&mut s, json!({"ids": [id.0], "relativeRadii": false}));
|
||||
assert!(s.doc().unwrap().doc.node(id).unwrap().live_shape().is_none(), "a plain path again");
|
||||
assert_eq!(steps(&s), n, "a plain path: no change");
|
||||
assert!(s.doc().unwrap().doc.node(id).unwrap().live_shape().is_none(), "still a plain path");
|
||||
let e = s.execute("shape.ellipse", &json!({"x": 200, "y": 200, "width": 50, "height": 30})).unwrap()["id"].as_u64().unwrap();
|
||||
let n = steps(&s);
|
||||
run(&mut s, json!({"ids": [e], "relativeRadii": true}));
|
||||
|
||||
@@ -356,7 +356,7 @@ pub(crate) fn corners_link(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
fn corners_popup(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
let Some(picked) = picked_corners(app) else { return };
|
||||
let lengths = general_lengths(app);
|
||||
let mut set = None;
|
||||
let (mut set, mut radius) = (None, None);
|
||||
Stack::new().show(ui, |ui, _| {
|
||||
Field::new(tl!("Corner")).show(ui, |ui, _| {
|
||||
let group = RadioGroup::new(tl!("Corner"), Bind::given(picked.kind)).show(ui, |ui, _| {
|
||||
@@ -371,13 +371,7 @@ fn corners_popup(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
}
|
||||
});
|
||||
Field::new(tl!("Radius")).show(ui, |ui, _| {
|
||||
let radius = NumberField::length(tl!("Radius"), Bind::given(picked.radius), lengths).show(ui).edit;
|
||||
apply_edits(app, &radius, EditPath::Scope, |app, v: &Option<f64>, _| {
|
||||
// A negative radius typed in rounds nothing: the command takes 0 or more.
|
||||
if let Some(r) = v {
|
||||
set_picked_corners(app, &picked, json!({"radius": r.max(0.0)}));
|
||||
}
|
||||
});
|
||||
radius = Some(NumberField::length(tl!("Radius"), Bind::given(picked.radius), lengths).show(ui).edit);
|
||||
});
|
||||
let rounding = RadioGroup::new(tl!("Rounding"), Bind::given(picked.relative)).show(ui, |ui, _| {
|
||||
Row::new().show(ui, |ui, _| {
|
||||
@@ -389,6 +383,15 @@ fn corners_popup(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
set = Some(json!({"relativeRadii": on}));
|
||||
}
|
||||
});
|
||||
// Applied after the Stack, whose body runs twice (measure, then real), as the radios' `set`.
|
||||
if let Some(radius) = radius {
|
||||
apply_edits(app, &radius, EditPath::Scope, |app, v: &Option<f64>, _| {
|
||||
// A negative radius typed in rounds nothing: the command takes 0 or more.
|
||||
if let Some(r) = v {
|
||||
set_picked_corners(app, &picked, json!({"radius": r.max(0.0)}));
|
||||
}
|
||||
});
|
||||
}
|
||||
if let Some(p) = set {
|
||||
set_picked_corners(app, &picked, p);
|
||||
}
|
||||
|
||||
+5
-5
@@ -7989,8 +7989,8 @@ polygon's from its first vertex clockwise; a star's from its first tip; an index
|
||||
Each corner keeps its own radius and kind (the shape's `live` in queries has `radii` and, when a corner isn't round,
|
||||
`kinds`); a corner with no radius is one anchor, a cut one two, and Direct-Selected corners stay selected as that
|
||||
changes. A path that isn't a live shape keeps its uncut outline (`live` `{"shape": "path", "base", "radii"}`) so its
|
||||
corners stay editable, and is a plain path again once no corner is cut, unless its rounding is Relative; a polygon
|
||||
stays a live polygon, its corners keeping the radius they shared when `sides` changes. Every corner is a circular arc tangent to both sides: a radius
|
||||
corners stay editable, and is a plain path again once no corner is cut; a polygon stays a live polygon, its corners
|
||||
keeping the radius they shared when `sides` changes. Every corner is a circular arc tangent to both sides: a radius
|
||||
draws no larger than takes the cut halfway along the corner's shorter side (half the shorter side of a rectangle, the
|
||||
same limit for its four corners), the corners stay circular through uneven scales (the radius scales by the mean scale,
|
||||
or keeps its size with Scale Corners off), and a rectangle from a file that kept an uneven scale in its transform
|
||||
@@ -8018,9 +8018,9 @@ Direct Selection, while a corner is selected or one live rectangle or polygon is
|
||||
the corners holding a Direct-Selected anchor, or every corner of a path selected whole; a path whose selected anchors
|
||||
hold no corner is left out. The pop-up has the corner kind, the radius (blank while the picked corners differ) and the
|
||||
rounding, Relative or Absolute (`relativeRadii`, which applies to each path as a whole; neither is chosen while the
|
||||
paths differ). A path without Live Corners is Absolute, and Relative on a path with a corner keeps its outline as the
|
||||
base of its Live Corners, as a radius does; ellipses and lines are left as they are. Editing a path's anchors (for
|
||||
example `path.moveAnchors`) ends its Live Corners, so it is Absolute again. With Relative rounding, a radius is
|
||||
paths differ). A path without Live Corners is Absolute: Relative leaves it, an ellipse or a line as it is, with no
|
||||
undo step. Editing a path's anchors (for example `path.moveAnchors`) ends its Live Corners, so it is Absolute again.
|
||||
With Relative rounding, a radius is
|
||||
compared as the fraction it stores (its share of the corner's maximum, at most all of it), so typing the radius
|
||||
shown again adds no undo step. The Corner Radius field beside the link sets the same corners. Each change runs one
|
||||
`object.setLiveShape` with `items`, one undo step, and the corners that were not picked keep their radius and kind.
|
||||
|
||||
@@ -1525,7 +1525,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
With Direct Selection, Shift pressed during the drag of a curved segment keeps both of its handles at right angles to the line between its anchors, on the same side and at the same length (`path.reshapeSegment {perpendicular}`). Shift held while any segment is dragged with the Anchor Point tool or the Pen with Alt does the same. With the Anchor Point tool, Shift held at the press on an anchor (or a selected blend's spine point) moves it, handles and all, instead of pulling out handles; Shift kept down keeps the move at 45° steps, and a Shift-click that doesn't move leaves the anchor as it was (`path.moveAnchor`). A selected blend spine's segment dragged with the Anchor Point tool, or a curved one dragged with Direct Selection, bends the same way (`object.blend.spine.reshapeSegment`).
|
||||
- **Live Corners:** drag a live rectangle's corner widgets (Selection or Direct Selection) to round all corners, with a radius readout; with Direct Selection, select corner anchors to show and round just those corners (#381). Each corner keeps its own radius and kind (Round, Inverted Round, Chamfer): Alt-click a widget to cycle the kind, double-click it with Direct Selection for the Corners dialog ([the help page](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-live-shapes/create-and-modify-live-shapes.html)) or with the Selection tool for the Transform panel (a double-click on a selected live shape's corner widget shows the Transform panel, [the help page](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-live-shapes/live-shape-properties.html); which tool gives which is VectorCraft's own rule), and the Properties and Transform radius fields set the selected corners (`object.setLiveShape {corners, radius, kind}`). A link toggle behind Corner Radius (the `singleCornerRadius` preference) switches the panels to a field for each corner of a live rectangle: Top Left, Top Right, Bottom Right and Bottom Left. Corners stay circular when the rectangle is scaled unevenly or along its own sides when rotated (the radius keeps its size, or scales by the mean scale with Scale Corners on); only a shear distorts them. On a rectangle that isn't square every corner is the same circle: a radius past half the shorter side stops there for all of them, the widgets sit on the corners as drawn and turn the edited corners red at that limit, CSS export writes the drawn radii, and rectangles saved stretched by older versions get circular corners when their corners are next set (#442). Live Corners work on any path's corners too, as on a rectangle's (#511): a star's, a live polygon's (which also shows them to the Selection tool, has a Corner Radius field in the Properties and Transform panels and keeps its radius as its sides change) and a pen path's, wherever two sides meet at an angle at an anchor that isn't smooth: curved sides too, trimmed to what the cut leaves of them (#1144). Direct Selection shows the widgets of every corner, or of the corners holding selected anchors; each corner is a circle tangent to both sides, drawn no larger than takes its cut halfway along its shorter side; a path keeps its uncut outline so its corners stay editable, and the same command, dialog, angle preference and View › Hide Corner Widget apply. With Direct Selection a click on a widget (no drag) selects its corner, as a click on the corner's anchor does, so the next drag on it rounds that corner alone; Shift-click toggles it (#1239). While a corner widget is dragged with the Selection tool the bounding box hides, so the rounding shows against the path alone (#1229). A round corner next to a curved side curves smoothly instead of sticking out of the shape (#1547, fixes #1512).
|
||||
View › Hide Edges hides the Live Corners widgets, the bounding box and the type widget, and the selection tools then do not answer a press on them or change the cursor over them.
|
||||
- **Corners link:** the Control bar and the Properties panel have a Corners link beside the radius field, which opens the Corners pop-up with the corner kind, the radius and the type of rounding of the selected corners; [the archived help page](https://web.archive.org/web/20200308215011/https://helpx.adobe.com/illustrator/using/reshape-with-live-corners.html) describes the link and these three settings. The pop-up picks corners across every selected path, names the rounding Relative or Absolute, shows the radius blank while the picked corners differ and no rounding while their paths differ, sets a typed value on the picked corners alone, and makes each change one undo step; these are VectorCraft's own rules. Relative rounding also works on a plain path with corners (`the_corners_link_opens_the_settings_of_the_picked_corners`, `the_corners_pop_up_sets_picked_corners_across_paths`, `the_control_bar_corners_link_opens_the_pop_up_for_the_picked_corners`, `relative_rounding_takes_on_a_plain_path`, `a_relative_radius_that_stores_the_same_fraction_adds_no_undo_step`; part of #1232).
|
||||
- **Corners link:** the Control bar and the Properties panel have a Corners link beside the radius field, which opens the Corners pop-up with the corner kind, the radius and the type of rounding of the selected corners; [the archived help page](https://web.archive.org/web/20200308215011/https://helpx.adobe.com/illustrator/using/reshape-with-live-corners.html) describes the link and these three settings. The pop-up picks corners across every selected path, names the rounding Relative or Absolute, shows the radius blank while the picked corners differ and no rounding while their paths differ, sets a typed value on the picked corners alone, and makes each change one undo step; these are VectorCraft's own rules (`the_corners_link_opens_the_settings_of_the_picked_corners`, `the_corners_pop_up_sets_picked_corners_across_paths`, `the_control_bar_corners_link_opens_the_pop_up_for_the_picked_corners`, `relative_rounding_without_live_corners_adds_no_undo_step`, `a_relative_radius_that_stores_the_same_fraction_adds_no_undo_step`; part of #1232).
|
||||
- **Rectangle Properties corner type:** a live rectangle's Rectangle Properties (Transform panel, the Properties panel's Transform section and the Contextual Task Bar's Shape Properties) have a Corner menu with Round, Inverted Round and Chamfer. With Corner Radius linked, one menu sets the kind of every corner of each selected rectangle, also corners with no radius, and shows blank when the shown rectangle's kinds differ; unlinked, each corner's row has its own menu beside its radius field, or under it in a panel too narrow for both; the unlinked radius fields and menus leave other selected paths and polygons as they are. A pick is one undo step, and picking the kind the corners already have adds none (`object.setLiveShape {kind, rectanglesOnly, corners}`); an action that records them acts on the rectangles selected when it plays. The help page says a rectangle's corner type can be set for each corner or for all of them at once ([the help page](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-live-shapes/live-shape-properties.html)); tying the number of menus to the Corner Radius link, the blank value and the undo steps are VectorCraft's own rules (`a_rectangle_shows_linked_and_unlinked_corner_types`, `the_shape_properties_popup_changes_a_rectangle_corner_type`, `the_linked_corner_menu_sets_every_selected_rectangle`, `the_unlinked_corner_menus_fit_a_narrow_panel`, `an_unlinked_corner_radius_leaves_other_selected_shapes`, `a_rectangle_corner_kind_without_a_selected_rectangle_changes_nothing`, `rectangle_kind_menu_targets_all_or_one_corner_and_skips_noop_undo`, `rectangles_only_sets_the_selected_rectangles_when_an_action_plays`, `a_radius_reaches_a_rectangle_that_already_draws_it`).
|
||||
- **Polygon side widget:** a selected live polygon shows a small diamond beside the middle of the right side of its bounding box, with the Selection tool and with the Rectangle, Rounded Rectangle, Ellipse, Polygon and Star tools, while the bounding box and the edges are shown. Dragging the widget sets the polygon's side count, from 3 to 11, as [the help page](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-live-shapes/add-or-remove-sides-from-polygons.html) describes; typed counts in the Transform panel and `object.setLiveShape` still go from 3 to 1000. A drag down adds one side and a drag up removes one for every 12 screen pixels along the box's own vertical axis, and the pointer shows the count while measurement labels are on. A polygon of more than 11 sides keeps its count until the drag goes up, which gives it 11. The drag sends `object.setLiveShape {sides}`, so the polygon keeps its center, radius and rotation; the release adds one undo step when the count changed and none when it ends where it began, and Escape puts the count back. The widget's look and place, the drag direction, the step and the rule for more than 11 sides are VectorCraft's own (`crates/tools/src/sidewidget.rs`).
|
||||
- **Polygon side slider:** Polygon Properties (Transform panel, the Properties panel's Transform section and the Contextual Task Bar's Shape Properties) have a Sides slider after the Sides field, over 3 to 20 sides. [The help page](https://helpx.adobe.com/illustrator/using/live-shapes.html) gives the slider that range and leaves larger counts, up to 1000, to the typed field, which still takes 3 to 1000. A drag previews the count through `object.setLiveShape {sides}` and its release adds one undo step; Escape during the drag puts the count back and adds no undo step. A click on the rail or an arrow key on it sets the count in one undo step. A count above 20 shows the handle at the rail's right end, and screen readers and the field show the real count, until the rail moves. The slider's place, the rule for counts above 20 and the undo steps are VectorCraft's own (`polygon_sides_slider_is_shared_by_transform_and_properties`, `polygon_sides_above_slider_range_remain_editable`, `polygon_sides_slider_drag_is_one_undo_step`).
|
||||
|
||||
Reference in new issue
Block a user