From b5a04a96005b9e2f9b890b4aabda69c48f91fc17 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 5 Mar 2025 01:15:54 -0700 Subject: [PATCH] [fontations] Fix sweep gradients --- src/fontations/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fontations/lib.rs b/src/fontations/lib.rs index d10db0c88..ee4ed863a 100644 --- a/src/fontations/lib.rs +++ b/src/fontations/lib.rs @@ -546,6 +546,8 @@ impl ColorPainter for HbColorPainter { extend, }; let mut color_line = self.make_color_line(&color_stops); + let start_angle = start_angle.to_radians(); + let end_angle = end_angle.to_radians(); unsafe { hb_paint_sweep_gradient( self.paint_funcs, @@ -553,8 +555,8 @@ impl ColorPainter for HbColorPainter { &mut color_line, c0.x, c0.y, + end_angle, // TODO Don't know why end_angle and start_angle are swapped, but produces correct results start_angle, - end_angle, ); } }