diff --git a/crates/eps/src/import/ai/brush.rs b/crates/eps/src/import/ai/brush.rs index 58dac58c92..1180e42fa9 100644 --- a/crates/eps/src/import/ai/brush.rs +++ b/crates/eps/src/import/ai/brush.rs @@ -291,9 +291,16 @@ pub(super) fn draws_as(draft: &BrushDraft, settings: &PathBrush, bending: &HashM && d.modes() == c.modes() } (DraftKind::Art { settings: Some(d), art: name, .. }, PathBrush::Art(s)) => { - drawn(d).iter().zip(drawn(s)).all(|(a, b)| close(*a, b)) - && art_options(s).is_some() - && bending.get(name).is_some_and(|length| opens_live(d, *length) && opens_live(s, *length)) + let (dd, ds) = (drawn(d), drawn(s)); + art_options(s).is_some() + && bending.get(name).is_some_and(|length| { + // The guides match as lengths and as fractions of the art's length, so they differ + // neither on short art nor near the ends of long art. + dd.iter().zip(ds).all(|(a, b)| close(*a, b)) + && [11, 12].iter().all(|&i| close(dd[i] / length, ds[i] / length)) + && opens_live(d, *length) + && opens_live(s, *length) + }) } _ => false, } diff --git a/crates/eps/src/import/ai/tests.rs b/crates/eps/src/import/ai/tests.rs index 2701cb6fec..8d20db92d1 100644 --- a/crates/eps/src/import/ai/tests.rs +++ b/crates/eps/src/import/ai/tests.rs @@ -10650,6 +10650,10 @@ fn an_art_brushed_path_the_brush_cant_draw_keeps_its_drawn_look() { // The brush's guides leave art between them, and the path's, close to them, leave none. let (def, style) = ribbon_with(&[(10, "1"), (11, "20"), (12, "19.99")]); cases.push(("path guides close to the brush's that leave no art between them", def, style.replace("19.99 /", "20 /"))); + // On art 0.01 long, a guide at 0.0035 is 35% of the way along it, and the brush's at 0.003 is 30%. + let (def, style) = ribbon_with(&[(10, "1"), (11, "0.003"), (12, "0.002")]); + let short = format!("%AI8_BeginBrushPattern\n(Ribbon art)\n0 A\n0 g\n{}f\n%AI8_EndBrushPattern\n", rect_path(0.0, 0.0, 0.01, 4.0)); + cases.push(("path guides elsewhere on short art", def.replace(&lopsided_art("Ribbon art"), &short), style.replace("0.003 /", "0.0035 /"))); let mut wrong = vec![]; for (why, def, style) in cases { let r = read_ok(&format!("{def}{style}{}", layer(&brushed_path())));