From 718c65c8550d5aeded2d92433ff5c79777e7d73a Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 21 Oct 2026 18:49:29 +0000 Subject: [PATCH 1/2] Ellipse pie angles in Transform and Properties (#3451) ## Summary Live ellipses already support pie start/end angles, canvas widgets and Invert Pie like Illustrator. Label the Properties panel Transform section with Ellipse Properties so the pie fields match the Transform panel and are easier to find. ## Tests - `an_ellipse_shows_its_pie_properties` in `panels/transform` tests. Closes storytold/vectorcraft#3451 Co-authored-by: nrq6993-a11y --- crates/ui-egui/src/panels/properties.rs | 5 ++++- crates/ui-egui/src/panels/transform.rs | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/panels/properties.rs b/crates/ui-egui/src/panels/properties.rs index 36d3f24e8..cdaf0829a 100644 --- a/crates/ui-egui/src/panels/properties.rs +++ b/crates/ui-egui/src/panels/properties.rs @@ -579,7 +579,10 @@ pub fn transform_section(app: &mut VectorcraftApp, ui: &mut Ui) { match &**live { vectorcraft_doc::LiveShape::Rectangle { .. } => corner_radius_row(app, ui, &n, "radius"), vectorcraft_doc::LiveShape::Polygon { .. } => super::transform::polygon_rows(app, ui, &n, live, "props-polygon"), - vectorcraft_doc::LiveShape::Ellipse { pie, .. } => super::transform::pie_rows(app, ui, *pie, "props-pie"), + vectorcraft_doc::LiveShape::Ellipse { pie, .. } => { + widgets::subheader(ui, tl!("Ellipse Properties:")); + super::transform::pie_rows(app, ui, *pie, "props-pie"); + } _ => {} } } diff --git a/crates/ui-egui/src/panels/transform.rs b/crates/ui-egui/src/panels/transform.rs index 67a407f02..92cedee07 100644 --- a/crates/ui-egui/src/panels/transform.rs +++ b/crates/ui-egui/src/panels/transform.rs @@ -505,6 +505,24 @@ mod tests { assert!(live(&app).polygon_sides_equal()); } + /// #3451: a live ellipse shows pie start/end angles and Invert Pie in the Transform panel and + /// the Properties panel's Transform section; typed angles update the shape. + #[test] + fn an_ellipse_shows_its_pie_properties() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + app.run("file.new", json!({"width": 300, "height": 300})).unwrap(); + app.run("shape.ellipse", json!({"x": 50, "y": 50, "width": 120, "height": 80})).unwrap(); + for draw in [show as fn(&mut VectorcraftApp, &mut Ui), crate::panels::properties::transform_section] { + let shown = texts(&mut app, draw); + for t in ["Ellipse Properties:", "Pie Start Angle:", "0°", "Pie End Angle:", "360°", "Invert Pie"] { + assert!(shown.iter().any(|s| s == t), "{t} in {shown:?}"); + } + } + app.run("object.setLiveShape", json!({"pieStart": 30, "pieEnd": 120})).unwrap(); + let shown = texts(&mut app, show); + assert!(shown.iter().any(|s| s == "30°") && shown.iter().any(|s| s == "120°"), "{shown:?}"); + } + #[test] fn the_artboard_tool_shows_the_active_artboard() { let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); From 6066b4b8c76208d45eb980daa3a10db234f77765 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 21 Oct 2026 23:23:57 +0000 Subject: [PATCH 2/2] Properties: regression test for ellipse pie in Transform section (#3451) Co-authored-by: nrq6993-a11y --- crates/ui-egui/src/panels/properties.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/crates/ui-egui/src/panels/properties.rs b/crates/ui-egui/src/panels/properties.rs index cdaf0829a..84446d84f 100644 --- a/crates/ui-egui/src/panels/properties.rs +++ b/crates/ui-egui/src/panels/properties.rs @@ -755,6 +755,22 @@ mod tests { assert_eq!(selected(&app), std::slice::from_ref(&mask), "Edit Clipping Path selects the clipping path"); } + /// #3451: the Properties panel Transform section shows ellipse pie angles and Invert Pie. + #[test] + fn transform_section_shows_ellipse_pie_properties() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 300, "height": 300})).unwrap(); + app.run("shape.ellipse", json!({"x": 50, "y": 50, "width": 120, "height": 80})).unwrap(); + let ctx = egui::Context::default(); + let labels: Vec = panel_frame(&mut app, &ctx, vec![], transform_section).into_iter().map(|(t, _)| t).collect(); + for t in ["Ellipse Properties:", "Pie Start Angle:", "0°", "Pie End Angle:", "360°", "Invert Pie"] { + assert!(labels.iter().any(|s| s == t), "{t} in {labels:?}"); + } + app.run("object.setLiveShape", json!({"pieStart": 30, "pieEnd": 120})).unwrap(); + let labels: Vec = panel_frame(&mut app, &ctx, vec![], transform_section).into_iter().map(|(t, _)| t).collect(); + assert!(labels.iter().any(|s| s == "30°") && labels.iter().any(|s| s == "120°"), "{labels:?}"); + } + /// The Snap Options and Scale Strokes & Effects checkboxes keep a visible box at rest in every /// theme, as the Preferences ones do (#1080), and toggle when clicked. #[test]