mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-03 06:31:42 +01:00
Pen: say what an open shape's stroke takes in its comments
This commit is contained in:
1 parent
0bc1a9d8b9
commit
fa14e59c5a
2 files changed
+3
-3
No files matched your search
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in new issue
Block a user