Skip to content
Permalink
Browse files

Set the line cap to butt when drawing a rect with a 0 width/height

Otherwise raqote will draw the cap even though it shouldn't because the
spec says so
  • Loading branch information...
Eijebong committed Aug 8, 2019
1 parent 9767408 commit 1dee418ff16a0c680ed6436cbce7850f9b21d79a
Showing with 3 additions and 1 deletion.
  1. +3 −1 components/canvas/canvas_data.rs
@@ -546,11 +546,13 @@ impl<'a> CanvasData<'a> {
);
});
} else if rect.size.width == 0. || rect.size.height == 0. {
let mut stroke_opts = self.state.stroke_opts.clone();
stroke_opts.set_line_cap(LineCapStyle::Butt);
self.drawtarget.stroke_line(
rect.origin,
rect.bottom_right(),
self.state.stroke_style.clone(),
&self.state.stroke_opts,
&stroke_opts,
&self.state.draw_options,
);
} else {

0 comments on commit 1dee418

Please sign in to comment.
You can’t perform that action at this time.