Merge pull request #8828 from dotCooCoo/feat/corner-widget-hover

Live Corners: hovering a corner widget highlights the corner it controls
This commit is contained in:
.CooCoo authored and GitHub committed 2026-11-28 02:16:55 -08:00
commit 1997b26e7b
6 files changed
+259 -8

No files matched your search

+29
View File
@@ -203,6 +203,35 @@ impl CornerWidgets {
out.insert(key.into(), value);
Value::Object(out)
}
/// The cut corner whose widget is within `tol` (document units) of `p`, as the path draws it in
/// the document, with the object it belongs to: what the canvas highlights while the pointer
/// is over that widget. `None` away from the widgets and for a corner with no cut.
pub fn hovered_cut(&self, doc: &Document, p: Point, tol: f64) -> Option<(NodeId, BezPath)> {
let (i, k) = self.hit(p, tol)?;
let (id, w) = (self.paths.get(i)?.id, self.widget(i, k)?);
let node = doc.node(id)?;
let NodeKind::Path { path, .. } = &node.kind else { return None };
let lc = LiveCorners::of(node)?;
let mut out = BezPath::new();
for (sp, from) in path.subpaths.iter().zip(lc.sources()) {
// A subpath whose anchors do not match its sources gives no cut rather than a wrong one.
if from.len() != sp.anchors.len() {
continue;
}
// A corner's cut is the segment between its two anchors (the last one, for a closed
// subpath's first corner); a square corner is one anchor and has none.
for s in 0..sp.segment_count() {
let (a, b) = (from.get(s), from.get(s + 1).or(from.first()));
if a == Some(&w.corner.index) && b == a {
let c = sp.segment(s);
out.move_to(c.p0);
out.curve_to(c.p1, c.p2, c.p3);
}
}
}
(!out.elements().is_empty()).then_some((id, out))
}
}
/// The angle between corner `c`'s sides once `xf` maps them into the document, in degrees.
+74
View File
@@ -538,3 +538,77 @@ fn a_pen_path_shows_widgets_on_its_corners_only() {
assert_eq!(w.corners(), [1, 2]);
assert_eq!(pts(&w)[0], Point::new(290.0, 110.0));
}
/// The bounds of the cut `w` gives for the pointer at `at`, rounded to 1e-6.
fn hovered_bounds(w: &CornerWidgets, d: &Document, at: Point) -> Option<(NodeId, [f64; 4])> {
let (id, cut) = w.hovered_cut(d, at, 5.0)?;
let b = vectorcraft_geom::Shape::bounding_box(&cut);
Some((id, [b.x0, b.y0, b.x1, b.y1].map(|v| (v * 1e6).round() / 1e6)))
}
/// #1232: the pointer within a press's reach of a widget gives the cut of the corner that widget
/// controls, for each corner of a rounded rectangle, the first one included; nothing away from
/// the widgets.
#[test]
fn a_widget_under_the_pointer_gives_its_corners_cut() {
let (d, id) = live_rect(20.0, Affine::translate((100.0, 100.0)));
let w = CornerWidgets::of(&d, &selected(id), 1.0, false).unwrap();
assert_eq!(pts(&w), [Point::new(120.0, 120.0), Point::new(180.0, 120.0), Point::new(180.0, 180.0), Point::new(120.0, 180.0)]);
let cuts = [[100.0, 100.0, 120.0, 120.0], [180.0, 100.0, 200.0, 120.0], [180.0, 180.0, 200.0, 200.0], [100.0, 180.0, 120.0, 200.0]];
for (at, cut) in pts(&w).into_iter().zip(cuts) {
assert_eq!(hovered_bounds(&w, &d, at + Vec2::new(3.0, -3.0)), Some((id, cut)), "{at:?}");
}
assert_eq!(hovered_bounds(&w, &d, Point::new(127.0, 120.0)), None, "past a press's reach");
assert_eq!(hovered_bounds(&w, &d, Point::new(150.0, 150.0)), None);
}
/// #1232: a square corner has no cut to give, and a plain path cut in one corner gives that
/// corner's cut from its own widget, with the corners Direct Selection shows, for each corner
/// kind.
#[test]
fn a_square_corner_gives_no_cut_and_a_plain_paths_corner_gives_its_own() {
let (d, id) = live_rect(0.0, Affine::translate((100.0, 100.0)));
let w = CornerWidgets::of(&d, &selected(id), 1.0, false).unwrap();
assert_eq!(hovered_bounds(&w, &d, Point::new(110.0, 110.0)), None);
for kind in [CornerKind::Round, CornerKind::InvertedRound, CornerKind::Chamfer] {
let (mut d, id) = doc_with_rect();
if let Some(NodeKind::Path { path, live, .. }) = d.node_mut(id).map(|n| &mut n.kind) {
vectorcraft_doc::corners::set_corners(path, live, &[2].into(), Some(30.0), Some(kind));
}
let w = CornerWidgets::of(&d, &selected(id), 1.0, true).unwrap();
assert_eq!(w.corners(), [0, 1, 2, 3], "{kind:?}");
assert_eq!(hovered_bounds(&w, &d, Point::new(110.0, 110.0)), None, "{kind:?}: the square top-left corner");
let at = pts(&w)[2];
assert_eq!(hovered_bounds(&w, &d, at), Some((id, [170.0, 170.0, 200.0, 200.0])), "{kind:?}");
}
}
/// #1232: a live polygon's widget gives its corner's cut, and a widget hidden by Hide Corner
/// Widget for angles greater than gives none at its place.
#[test]
fn a_polygons_widget_gives_its_cut_and_a_hidden_widget_gives_none() {
let live =
LiveShape::Polygon { radius: 80.0, sides: 6, xf: Affine::translate((200.0, 200.0)), radii: vec![], kinds: vec![], radii_relative: false };
let (mut d, id) = doc_with(live.to_path(), Some(live));
if let Some(NodeKind::Path { path, live, .. }) = d.node_mut(id).map(|n| &mut n.kind) {
vectorcraft_doc::corners::set_corners(path, live, &[0].into(), Some(10.0), None);
}
let w = CornerWidgets::of(&d, &selected(id), 1.0, false).unwrap();
let at = pts(&w)[0];
let (got, b) = hovered_bounds(&w, &d, at).unwrap();
assert_eq!(got, id);
// The arc of a 10 pt radius at a 120° corner spans 10 pt between its ends.
let (wide, high) = (b[2] - b[0], b[3] - b[1]);
assert!(wide.max(high) <= 10.5 && wide.max(high) > 5.0, "{b:?}");
let centre = Point::new((b[0] + b[2]) / 2.0, (b[1] + b[3]) / 2.0);
assert!(centre.distance(at) < 15.0, "{b:?} {at:?}");
// Sheared by 30°: the rectangle's 120° corners (1 and 3) hide above 100°.
let shear = Affine::translate((100.0, 100.0)) * Affine::new([1.0, 0.0, 30f64.to_radians().tan(), 1.0, 0.0, 0.0]);
let (d, id) = live_rect(10.0, shear);
let all = CornerWidgets::of(&d, &selected(id), 1.0, false).unwrap();
let shown = all.clone().within_angle(100.0).unwrap();
assert_eq!(shown.corners(), [0, 2]);
assert!(hovered_bounds(&shown, &d, pts(&all)[0]).is_some());
assert!(hovered_bounds(&all, &d, pts(&all)[1]).is_some(), "shown, the 120° corner has a cut");
assert_eq!(hovered_bounds(&shown, &d, pts(&all)[1]), None, "hidden, it gives none");
}
+107 -8
View File
@@ -9,8 +9,9 @@ use craft::draw::ui::corner::{CornerPoint, CornerTarget};
use craft::draw::ui::transform::TransformReach;
use craft::draw::ui::{CornerKind, CornerWidgets, TransformBox};
use craft::ui::canvas::canvas_space;
use craft::ui::canvas_controls::path_runs;
use craft::ui::contract::{Access, Bind, Common, Component, Cx, MeasureCx, PaintUi, Props as _, Role, Show as _};
use craft::ui::primitives::{PaintShape, StrokeColor, StrokeWidth};
use craft::ui::primitives::{DataWidth, PaintShape, StrokeColor, StrokeWidth};
use craft::ui::style::{ComponentStyle, DataColor, StyleColor, StyleCx};
use egui::{Color32, Pos2, Response, vec2};
use vectorcraft_doc::{Document, LiveCorners, LiveShape, NodeId, NodeKind, OrientedBox};
@@ -21,6 +22,12 @@ use super::BodyKind;
use crate::VectorcraftApp;
use crate::doc_windows::Win;
/// How near the pointer comes to a Live Corners widget, in screen points, for the corner it controls to be
/// highlighted: the distance at which a press picks the widget.
const CORNER_HOVER_REACH: f64 = 5.0;
/// The width, in screen points, of the cut corner drawn while the pointer is over its Live Corners widget.
const CORNER_HOVER_WIDTH: f32 = 2.0;
/// The bounding box on show: the box and the layer colour it is drawn in.
#[derive(Clone, Copy, Debug, PartialEq)]
pub(super) struct ShownBox {
@@ -112,6 +119,19 @@ fn corner_target(doc: &Document, id: NodeId, indices: &[usize]) -> Option<Corner
(!corners.is_empty()).then(|| CornerTarget::new(id.0, corners, individual))
}
/// The Live Corners widgets `tool` shows at `zoom`: Selection and the shape tools on a live rectangle or polygon
/// while Show Shape Widgets is on, Direct Selection on any path, within the Hide Corner Widget angle. `tool` is the
/// tool whose widgets the canvas shows ([`super::shown_tool`]).
fn shown_corners(app: &VectorcraftApp, tool: &str, zoom: f64) -> Option<vectorcraft_tools::corners::CornerWidgets> {
let direct = tool == "directSelection";
if !(matches!(tool, "selection" | "directSelection") || shape_tool_idle(app, tool)) {
return None;
}
let st = app.session.active()?;
let on = app.ui.view.corner_widgets && (direct || app.ui.view.shape_widgets);
vectorcraft_tools::corners::CornerWidgets::showing(&st.doc, &st.selection, zoom, direct, on, app.session.prefs.hide_corner_widget_above)
}
/// The Live Corners widgets on show, one group per layer colour so each draws in its object's colour: Selection
/// and the shape tools on a live rectangle or polygon while Show Shape Widgets is on, Direct Selection on any
/// path. Only the corners the tool hit-tests are listed, those within the Hide Corner Widget angle. `tool` is the tool
@@ -119,14 +139,8 @@ fn corner_target(doc: &Document, id: NodeId, indices: &[usize]) -> Option<Corner
// PLAN: the decision's `(.., f64)` is dropped: the corners listed are already those within the angle, so no
// angle is left to hand on.
pub(super) fn corners(app: &VectorcraftApp, tool: &str, zoom: f64) -> Option<Vec<(DataColor, Vec<CornerTarget>)>> {
let direct = tool == "directSelection";
if !(matches!(tool, "selection" | "directSelection") || shape_tool_idle(app, tool)) {
return None;
}
let shown = shown_corners(app, tool, zoom)?;
let st = app.session.active()?;
let on = app.ui.view.corner_widgets && (direct || app.ui.view.shape_widgets);
let shown =
vectorcraft_tools::corners::CornerWidgets::showing(&st.doc, &st.selection, zoom, direct, on, app.session.prefs.hide_corner_widget_above)?;
// `visible_on` and `corners` list the same corners in the same order: path after path.
let mut per_path: Vec<(NodeId, Vec<usize>)> = vec![];
for ((id, _), index) in shown.visible_on().zip(shown.corners()) {
@@ -147,6 +161,26 @@ pub(super) fn corners(app: &VectorcraftApp, tool: &str, zoom: f64) -> Option<Vec
Some(groups)
}
/// The cut of the corner whose Live Corners widget is on show within 5 screen points of `at` (the distance at which
/// a press picks the widget), with its layer colour: what the canvas highlights under the pointer. `None` while the
/// tool is busy or a mouse button is down (`button_down`; a pan drag leaves the tool idle), away from the widgets,
/// and for a square corner, which has no cut. `tool` is the tool whose widgets the canvas shows.
pub(super) fn corner_hover(
app: &VectorcraftApp,
tool: &str,
zoom: f64,
at: Option<vectorcraft_geom::Point>,
button_down: bool,
) -> Option<(DataColor, vectorcraft_geom::BezPath)> {
if button_down || app.session.tool_busy() {
return None;
}
let shown = shown_corners(app, tool, zoom)?;
let st = app.session.active()?;
let (id, cut) = shown.hovered_cut(&st.doc, at?, CORNER_HOVER_REACH / zoom.max(1e-9))?;
Some((data_color(st.doc.layer_color(id)), cut))
}
fn corner_kind(kind: DocCornerKind) -> CornerKind {
match kind {
DocCornerKind::Round => CornerKind::Round,
@@ -342,6 +376,65 @@ impl Component for ShapeWidgets {
}
}
/// The cut of the corner whose Live Corners widget the pointer is over, drawn under the widgets in its layer colour
/// as one paint-only canvas control.
#[derive(craft::ui::contract::Component, craft::ui::contract::Props)]
#[component(canvas_control)]
pub struct CornerHover {
#[common]
common: Common,
cut: vectorcraft_geom::BezPath,
color: DataColor,
}
impl CornerHover {
fn new(cut: vectorcraft_geom::BezPath, color: DataColor) -> Self {
CornerHover { common: Common::new(), cut, color }.label("Corner highlight")
}
}
/// The style of the corner highlight.
#[derive(Clone, Debug, PartialEq, ComponentStyle)]
#[non_exhaustive]
pub struct CornerHoverStyle {
#[style(metrics)]
metrics: Metrics,
}
impl Component for CornerHover {
const ROLE: Role = Role::GRAPHICS_OBJECT;
const INPUT: Input = Input::Display;
const PARTS: bool = false;
const STOPS: bool = false;
const OVERLAYS: bool = false;
type Style = CornerHoverStyle;
type Output = Response;
fn style(_: &StyleCx<'_>, _: CornerHoverStyleKey) -> CornerHoverStyle {
CornerHoverStyle { metrics: Metrics::new() }
}
fn measure(&mut self, _: &MeasureCx<'_, Self>) -> egui::Vec2 {
egui::Vec2::ZERO
}
fn paint(&mut self, ui: &mut PaintUi<'_>, cx: &Cx<'_, Self>) {
let Some(space) = canvas_space(&cx.env) else { return };
let draw = ui.draw();
for (points, _) in path_runs(&space.view, &self.cut) {
draw.stroke(&PaintShape::Path(points), DataWidth::points(CORNER_HOVER_WIDTH), StrokeColor::Data(self.color));
}
}
fn access(&self, access: &mut Access, _: &Cx<'_, Self>) {
access.description("Corner highlight");
}
fn finish(self, cx: Cx<'_, Self>) -> Response {
cx.response.clone()
}
}
/// Shows the bounding box, Live Corners and the shape widgets over the selection of the live document. The box,
/// Live Corners, type, side and pie widgets need View › Show Edges; the blend and Objects on Path widgets do not.
/// Nothing here is shown while a revolve is edited.
@@ -357,6 +450,12 @@ pub(super) fn show(app: &mut VectorcraftApp, ui: &mut egui::Ui, space: &craft::u
let tool = super::shown_tool(app, ui.ctx());
let shown = if edges { bounding_box(app, tool) } else { None };
if edges {
// The pointer of this pass: `hover_doc` is only set after the canvas body has been shown.
let (pointer, button_down) = ui.input(|i| (i.pointer.hover_pos(), i.pointer.any_down()));
let at = pointer.filter(|_| ui.rect_contains_pointer(rect)).map(|p| space.view.to_doc(p));
if let Some((color, cut)) = corner_hover(app, tool, space.view.zoom, at, button_down) {
CornerHover::new(cut, color).show_at(ui, rect);
}
for (at, (color, targets)) in corners(app, tool, space.view.zoom).into_iter().flatten().enumerate() {
CornerWidgets::new("Live Corners", Bind::given(targets)).id_salt(at).reach(TransformReach::Shown).color(color).show_at(ui, rect);
}
@@ -101,6 +101,50 @@ fn corner_widgets_hide_above_the_preference_angle() {
assert!(corners(&app, app.session.tool_id(), app.view_info().zoom).is_none());
}
/// #1232: the pointer within 5 screen points of a corner widget gives the cut of the corner it controls, in the
/// layer colour, with Direct Selection, the Selection tool and the Rectangle tool. It gives none with a mouse button
/// down (a press on the widget or a pan), during a drag from the widget, off the canvas, away from the widgets, or
/// where the widget is hidden by Hide Corner Widget for angles greater than.
#[test]
fn hovering_a_corner_widget_highlights_its_corner() {
let mut app = new_app(&[]);
let id = make(&mut app, "shape.rectangle", json!({"x": 100, "y": 100, "width": 100, "height": 100}));
app.session.execute("object.setLiveShape", &json!({"id": id, "radius": 20})).unwrap();
let color = layer(&app, id);
let zoom = app.view_info().zoom;
let bounds = |cut: &vectorcraft_geom::BezPath| {
let b = vectorcraft_geom::Shape::bounding_box(cut);
[b.x0, b.y0, b.x1, b.y1].map(|v| (v * 1e6).round() / 1e6)
};
let mut top_left = vectorcraft_geom::Point::ZERO;
for tool in ["directSelection", "selection", "rectangle"] {
app.select_tool(tool);
let st = app.session.active().unwrap();
top_left =
vectorcraft_tools::corners::CornerWidgets::of(&st.doc, &st.selection, zoom, tool == "directSelection").unwrap().visible().next().unwrap();
let (got, cut) = corner_hover(&app, tool, zoom, Some(top_left), false).unwrap_or_else(|| panic!("{tool}: over the widget"));
assert_eq!(got, color, "{tool}");
assert_eq!(bounds(&cut), [100.0, 100.0, 120.0, 120.0], "{tool}: the top-left arc");
let near = top_left + vectorcraft_geom::Vec2::new(3.0 / zoom, -3.0 / zoom);
assert!(corner_hover(&app, tool, zoom, Some(near), false).is_some(), "{tool}: within reach");
let far = top_left + vectorcraft_geom::Vec2::new(7.0 / zoom, 0.0);
assert!(corner_hover(&app, tool, zoom, Some(far), false).is_none(), "{tool}: past a press's reach");
assert!(corner_hover(&app, tool, zoom, Some(vectorcraft_geom::Point::new(150.0, 150.0)), false).is_none(), "{tool}: away from the widgets");
assert!(corner_hover(&app, tool, zoom, None, false).is_none(), "{tool}: off the canvas");
assert!(corner_hover(&app, tool, zoom, Some(top_left), true).is_none(), "{tool}: a button down");
let inward = (top_left.x + 8.0, top_left.y + 8.0);
drag(&mut app, (top_left.x, top_left.y), inward);
assert!(app.session.tool_busy(), "{tool}");
assert!(corner_hover(&app, tool, zoom, Some(top_left), false).is_none(), "{tool}: during the drag");
pointer(&mut app, PointerKind::Up, inward);
app.session.execute("edit.undo", &json!({})).unwrap();
}
app.select_tool("directSelection");
assert!(corner_hover(&app, "directSelection", zoom, Some(top_left), false).is_some(), "Direct Selection, before the preference");
app.session.execute("prefs.set", &json!({"key": "hideCornerWidgetAbove", "value": 80})).unwrap();
assert!(corner_hover(&app, "directSelection", zoom, Some(top_left), false).is_none(), "hidden above the angle");
}
#[test]
fn a_resize_drag_keeps_the_bounding_box_at_the_new_bounds() {
for real_time in [true, false] {
+4
View File
@@ -8632,6 +8632,10 @@ and those shape tools: hidden widgets are not drawn, and those tools do not answ
on them. `on`, when given and not `null`, must be `true` or `false` and sets the state; without it, or with `null`, the
command toggles. The reply is the new state (`true` when shown, the default). The bounding box, the center point and
Direct Selection's corner widgets, which follow `view.cornerWidget` alone, stay as they are, and no undo step is added.
While the pointer is within 5 px of a corner widget that shows, with any tool that shows it, the desktop app draws the
cut of that widget's corner (round, inverted round or chamfer) in a 2 px line of the layer color. A square corner has
no cut and gets no line, and no line is drawn while a mouse button is down. The 5 px reach, the 2 px width and the
color are VectorCraft's own values. No command runs and no undo step is added.
In the desktop app, the Corners link in the Control bar (beside the anchor controls) and in the Properties panel (with
Direct Selection, while a corner is selected or one live rectangle or polygon is selected) opens the Corners pop-up for the picked corners of every selected path:
the corners holding a Direct-Selected anchor, or every corner of a path selected whole; a path whose selected anchors
+1
View File
@@ -1602,6 +1602,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.
With the pointer on a Direct Selection corner widget or close to it, the canvas marks the cut of that widget's corner with a thicker line (#1232). The help page describes this marking of a widget's corner while the pointer is on the widget or close to it ([Live Corners help page, archived](https://web.archive.org/web/2016id_/https://helpx.adobe.com/illustrator/using/reshape-with-live-corners.html)). As VectorCraft's own rules, the mark also shows with the Selection tool and the shape tools on the widgets they show, it is a 2 px line of the layer color within 5 px of the widget, a square corner gets none, and none is drawn while a mouse button is down. Tests: `corners::tests::a_widget_under_the_pointer_gives_its_corners_cut`, `corners::tests::a_square_corner_gives_no_cut_and_a_plain_paths_corner_gives_its_own`, `corners::tests::a_polygons_widget_gives_its_cut_and_a_hidden_widget_gives_none`, `canvas::widgets::tests::hovering_a_corner_widget_highlights_its_corner`.
- **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`).