canvas: Do not draw arc/ellipse with small sweep (#37630)

While raqote does already passes this test, but small line is still
visible and this PR will fix this. Vello will not work correctly without
this.


![slika](https://github.com/user-attachments/assets/195cd2c8-bea4-46d8-bf34-9c2d0b2e996e)


Testing: `/html/canvas/element/path-objects/2d.path.arc.twopie.1.html`

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
sagudev 2025-07-01 14:01:15 +02:00 committed by GitHub
parent 9543482f51
commit e0af75f265
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -200,6 +200,10 @@ pub(crate) trait GenericPathBuilder<B: Backend> {
self.line_to(arc.from());
if sweep.radians.abs() < 1e-3 {
return;
}
arc.for_each_quadratic_bezier(&mut |q| {
self.quadratic_curve_to(&q.ctrl, &q.to);
});