From 1a7cb29bf283bf657564a185b3a5cd1e938a0469 Mon Sep 17 00:00:00 2001 From: HassanKhan Date: Wed, 25 Nov 2026 10:38:21 +0500 Subject: [PATCH 1/2] Stroke panel: the cap icons mark the end of the path in one place The end-of-path line sat at x=16 in Butt and Projecting but at x=12 in Round, and the stroke bar was as opaque as the line, so the line vanished where it crossed the bar and the three icons looked alike. The line is now at x=13 in all three over a lighter (0.55) bar, as the stroke-align icons draw it, and the caps are larger, so Round and Projecting reach 5 units past the end instead of 4. Fixes #9229 --- assets/icons/dc-cap-butt.svg | 2 +- assets/icons/dc-cap-round.svg | 2 +- assets/icons/dc-cap-square.svg | 2 +- crates/ui-egui/src/icons.rs | 26 ++++++++++++++++++++++++++ 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/assets/icons/dc-cap-butt.svg b/assets/icons/dc-cap-butt.svg index bf39a170a6..dee85e09a0 100644 --- a/assets/icons/dc-cap-butt.svg +++ b/assets/icons/dc-cap-butt.svg @@ -1 +1 @@ - + diff --git a/assets/icons/dc-cap-round.svg b/assets/icons/dc-cap-round.svg index 06af9d07ea..bcf2e976c4 100644 --- a/assets/icons/dc-cap-round.svg +++ b/assets/icons/dc-cap-round.svg @@ -1 +1 @@ - + diff --git a/assets/icons/dc-cap-square.svg b/assets/icons/dc-cap-square.svg index 4a82a10d9a..5fcb2e3c5d 100644 --- a/assets/icons/dc-cap-square.svg +++ b/assets/icons/dc-cap-square.svg @@ -1 +1 @@ - + diff --git a/crates/ui-egui/src/icons.rs b/crates/ui-egui/src/icons.rs index 46b96ae2c1..c37f17c103 100644 --- a/crates/ui-egui/src/icons.rs +++ b/crates/ui-egui/src/icons.rs @@ -207,6 +207,32 @@ mod tests { assert!(appearance.contains(" String { + let last = icon.rsplit(" f32 { + icon.split(r#"fill-opacity=""#).nth(1).and_then(|s| s.split('"').next()).and_then(|v| v.parse().ok()).unwrap_or(1.0) + }; + let icons = [("butt", svg("dc-cap-butt")), ("round", svg("dc-cap-round")), ("square", svg("dc-cap-square"))]; + let butt_end = end_line(&icons[0].1); + assert!(butt_end.starts_with('M') && butt_end.contains('V'), "the butt cap icon ends with a vertical end-of-path line: {butt_end}"); + for (name, icon) in &icons { + assert_eq!(end_line(icon), butt_end, "the {name} cap icon marks the end of the path where the butt cap icon does"); + assert!(stroke_opacity(icon) < 1.0, "the {name} cap icon's stroke is lighter than its end-of-path line"); + } + } + // Regression test for #479: the Add and Delete Anchor Point tools' icons were drawn apart from // the Pen tool's, so the three tools didn't read as one family. They are the Pen's pen with a // plus or a minus beside it. From ca4fa0171bf7db0d4519f72f97bc71fdd5d14bfc Mon Sep 17 00:00:00 2001 From: HassanKhan Date: Thu, 26 Nov 2026 12:41:14 +0500 Subject: [PATCH 2/2] Stroke panel: cap icon test also checks the three strokes differ (#9229) --- crates/ui-egui/src/icons.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/ui-egui/src/icons.rs b/crates/ui-egui/src/icons.rs index fc362bce98..30b6edfb49 100644 --- a/crates/ui-egui/src/icons.rs +++ b/crates/ui-egui/src/icons.rs @@ -231,6 +231,13 @@ mod tests { assert_eq!(end_line(icon), butt_end, "the {name} cap icon marks the end of the path where the butt cap icon does"); assert!(stroke_opacity(icon) < 1.0, "the {name} cap icon's stroke is lighter than its end-of-path line"); } + // The stroke bar, everything before the end-of-path line, shows each cap differently. + let bar = |icon: &str| -> String { icon.rsplit_once("