Skip to content

Commit d04def8

Browse files
Ensure non-negative lengths for stroke dash pattern (#3710)
Caused Vello rendering to fail
1 parent 7e436f4 commit d04def8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

node-graph/libraries/rendering/src/renderer.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,13 +1036,14 @@ impl Render for Table<Vector> {
10361036
StrokeJoin::Bevel => Join::Bevel,
10371037
StrokeJoin::Round => Join::Round,
10381038
};
1039+
let dash_pattern = stroke.dash_lengths.iter().map(|l| l.max(0.)).collect();
10391040
let stroke = kurbo::Stroke {
10401041
width: stroke.weight * width_scale,
10411042
miter_limit: stroke.join_miter_limit,
10421043
join,
10431044
start_cap: cap,
10441045
end_cap: cap,
1045-
dash_pattern: stroke.dash_lengths.into(),
1046+
dash_pattern,
10461047
dash_offset: stroke.dash_offset,
10471048
};
10481049

0 commit comments

Comments
 (0)