mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
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:
parent
97674082d3
commit
1dee418ff1
1 changed files with 3 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue