From e0af75f265887b670aef2b2147db21b51406cd60 Mon Sep 17 00:00:00 2001 From: sagudev <16504129+sagudev@users.noreply.github.com> Date: Tue, 1 Jul 2025 14:01:15 +0200 Subject: [PATCH] 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> --- components/canvas/backend.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/canvas/backend.rs b/components/canvas/backend.rs index 63df9d00fe6..512d5a30e34 100644 --- a/components/canvas/backend.rs +++ b/components/canvas/backend.rs @@ -200,6 +200,10 @@ pub(crate) trait GenericPathBuilder { 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); });