Ensure non-negative lengths for stroke dash pattern (#3710)
Caused Vello rendering to fail
This commit is contained in:
parent
7e436f48f9
commit
d04def886d
|
|
@ -1036,13 +1036,14 @@ impl Render for Table<Vector> {
|
||||||
StrokeJoin::Bevel => Join::Bevel,
|
StrokeJoin::Bevel => Join::Bevel,
|
||||||
StrokeJoin::Round => Join::Round,
|
StrokeJoin::Round => Join::Round,
|
||||||
};
|
};
|
||||||
|
let dash_pattern = stroke.dash_lengths.iter().map(|l| l.max(0.)).collect();
|
||||||
let stroke = kurbo::Stroke {
|
let stroke = kurbo::Stroke {
|
||||||
width: stroke.weight * width_scale,
|
width: stroke.weight * width_scale,
|
||||||
miter_limit: stroke.join_miter_limit,
|
miter_limit: stroke.join_miter_limit,
|
||||||
join,
|
join,
|
||||||
start_cap: cap,
|
start_cap: cap,
|
||||||
end_cap: cap,
|
end_cap: cap,
|
||||||
dash_pattern: stroke.dash_lengths.into(),
|
dash_pattern,
|
||||||
dash_offset: stroke.dash_offset,
|
dash_offset: stroke.dash_offset,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue