Ensure non-negative lengths for stroke dash pattern (#3710)

Caused Vello rendering to fail
This commit is contained in:
Timon 2026-02-03 18:19:31 +01:00 committed by GitHub
parent 7e436f48f9
commit d04def886d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -1036,13 +1036,14 @@ impl Render for Table<Vector> {
StrokeJoin::Bevel => Join::Bevel,
StrokeJoin::Round => Join::Round,
};
let dash_pattern = stroke.dash_lengths.iter().map(|l| l.max(0.)).collect();
let stroke = kurbo::Stroke {
width: stroke.weight * width_scale,
miter_limit: stroke.join_miter_limit,
join,
start_cap: cap,
end_cap: cap,
dash_pattern: stroke.dash_lengths.into(),
dash_pattern,
dash_offset: stroke.dash_offset,
};