From fa14e59c5a249f6fcfc129f4d2a0cde7e7ef1829 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sat, 14 Nov 2026 21:45:58 +0100 Subject: [PATCH] Pen: say what an open shape's stroke takes in its comments --- crates/ui-egui/src/pen_path_ownership_tests.rs | 3 +-- crates/ui-egui/src/tools/vector_ui/shapes.rs | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/pen_path_ownership_tests.rs b/crates/ui-egui/src/pen_path_ownership_tests.rs index 83c6c6c309e..47d01882aba 100644 --- a/crates/ui-egui/src/pen_path_ownership_tests.rs +++ b/crates/ui-egui/src/pen_path_ownership_tests.rs @@ -138,8 +138,7 @@ fn captured_pen_paint_preserves_float_colour_and_alpha_after_toolbar_changes() { let LayerContent::Shape(shape) = &st.doc.layer(st.active_layer.unwrap()).unwrap().content else { panic!("expected Pen shape") }; let paint = |c: [f32; 4]| photocraft_doc::Fill::Solid(photocraft_doc::Color::rgba(c[0], c[1], c[2], c[3])); assert_eq!(shape.fill, closed.then(|| paint(foreground))); - // Both open and closed shapes use the captured stroke paint; previously open paths - // incorrectly substituted the captured fill/foreground colour. + // Open and closed shapes both take the captured stroke paint. assert_eq!(shape.stroke.as_ref().unwrap().paint, paint(background)); } } diff --git a/crates/ui-egui/src/tools/vector_ui/shapes.rs b/crates/ui-egui/src/tools/vector_ui/shapes.rs index 0275460a1cb..4956aefb401 100644 --- a/crates/ui-egui/src/tools/vector_ui/shapes.rs +++ b/crates/ui-egui/src/tools/vector_ui/shapes.rs @@ -27,7 +27,8 @@ pub(super) fn stroke_param(app: &PhotocraftApp) -> Value { p } -/// An open Pen shape needs a visible fallback when no stroke is configured. +/// An open Pen shape's stroke: the options bar's stroke when one is set, else a 1 px stroke in the +/// foreground colour, so the open path stays visible. pub(super) fn open_pen_stroke_param(app: &PhotocraftApp) -> Value { let stroke = stroke_param(app); if !stroke.is_null() {