mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-12 16:23:01 +00:00
[fontations] Comment
This commit is contained in:
parent
b5a04a9600
commit
a2d9c29b08
1 changed files with 9 additions and 3 deletions
|
@ -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,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue