[fontations] Comment

This commit is contained in:
Behdad Esfahbod 2025-03-05 01:48:40 -07:00 committed by Khaled Hosny
parent b5a04a9600
commit a2d9c29b08

View file

@ -502,8 +502,8 @@ impl ColorPainter for HbColorPainter {
p0.y,
p1.x,
p1.y,
p1.x, // TODO: Where's p2?
p1.y, // TODO: Where's p2?
p0.x, // TODO: Where's p2?
p0.y,
);
}
}
@ -548,6 +548,12 @@ impl ColorPainter for HbColorPainter {
let mut color_line = self.make_color_line(&color_stops);
let start_angle = start_angle.to_radians();
let end_angle = end_angle.to_radians();
// Skrifa has this gem, so we swap end_angle and start_angle
// when passing to our API:
//
// * Convert angles and stops from counter-clockwise to clockwise
// * for the shader if the gradient is not already reversed due to
// * start angle being larger than end angle.
unsafe {
hb_paint_sweep_gradient(
self.paint_funcs,
@ -555,7 +561,7 @@ 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
end_angle,
start_angle,
);
}