diff --git a/crates/engine/src/cmd/brushlib.rs b/crates/engine/src/cmd/brushlib.rs index 8f72e64676..7eb1af3dba 100644 --- a/crates/engine/src/cmd/brushlib.rs +++ b/crates/engine/src/cmd/brushlib.rs @@ -529,7 +529,8 @@ fn ornamental() -> BrushLibrary { black(polygon(&[(60.0, 3.0), (66.0, 5.0), (72.0, -1.0), (67.0, -2.0)])), ]); let arrow = group(vec![ - black(shapes::rectangle(Rect::new(4.0, -0.7, 84.0, 0.7))), + // The shaft runs into the head's notch at x = 85 so the two overlap. + black(shapes::rectangle(Rect::new(4.0, -0.7, 86.0, 0.7))), black(polygon(&[(80.0, -6.5), (100.0, 0.0), (80.0, 6.5), (85.0, 0.0)])), ring(Point::new(7.0, 0.0), 4.0, 1.7), black(polygon(&[(25.0, -0.4), (31.0, -4.4), (37.0, -2.0), (31.0, 0.8)])), diff --git a/crates/engine/src/tests/brushlib.rs b/crates/engine/src/tests/brushlib.rs index aecce4717a..9b57a22bb0 100644 --- a/crates/engine/src/tests/brushlib.rs +++ b/crates/engine/src/tests/brushlib.rs @@ -334,6 +334,26 @@ fn ornamental_brushes_draw_flourishes_and_survive_a_saved_library() { assert_eq!(vectorcraft_brush::library(&reopened), lib.brushes); } +/// Filigree Arrow's shaft runs into its head with no gap, so a straight stroke draws one arrow. +#[test] +fn the_filigree_arrow_shaft_meets_its_head() { + let s = session(); + let (_, lib) = cmd::brushlib::library(&s, "Ornamental").unwrap(); + let BrushKind::Art(art) = &lib.brush("Filigree Arrow").unwrap().kind else { panic!("Filigree Arrow is not an art brush") }; + let mut parts = vec![]; + art.art.walk(&mut |c| { + if c.path_data().is_some() { + parts.push(c.contains_fn()); + } + }); + for y in [-0.6, 0.0, 0.6] { + for i in 0..=930 { + let p = vectorcraft_geom::Point::new(4.05 + 0.1 * f64::from(i), y); + assert!(parts.iter().any(|inside| inside(p)), "gap at {p:?}"); + } + } +} + #[test] fn pressure_sensitive_brushes_widen_with_pen_pressure_and_survive_a_saved_library() { let mut s = session();