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
This commit is contained in:
Bastien Orivel 2019-08-08 21:27:23 +02:00
parent 97674082d3
commit 1dee418ff1

View file

@ -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 {