[ft-paint] Fix some fixed->float conversions

This commit is contained in:
Matthias Clasen 2022-12-23 02:41:08 -05:00 committed by Behdad Esfahbod
parent 07ba5be393
commit 0d5256e5a7
1 changed files with 15 additions and 15 deletions

View File

@ -99,7 +99,7 @@ _hb_ft_color_line_get_color_stops (hb_color_line_t *color_line,
&stop, &stop,
&c->color_stop_iterator)) &c->color_stop_iterator))
{ {
color_stops->offset = stop.stop_offset / 65536.f; color_stops->offset = stop.stop_offset / 16384.f;
color_stops->is_foreground = stop.color.palette_index == 0xFFFF; color_stops->is_foreground = stop.color.palette_index == 0xFFFF;
if (color_stops->is_foreground) if (color_stops->is_foreground)
color_stops->color = HB_COLOR (hb_color_get_blue (data->foreground), color_stops->color = HB_COLOR (hb_color_get_blue (data->foreground),
@ -200,12 +200,12 @@ _hb_ft_paint (FT_OpaquePaint opaque_paint,
}; };
paint_funcs->linear_gradient (paint_data, &cl, paint_funcs->linear_gradient (paint_data, &cl,
paint.u.linear_gradient.p0.x, paint.u.linear_gradient.p0.x / 65535.f,
paint.u.linear_gradient.p0.y, paint.u.linear_gradient.p0.y / 65535.f,
paint.u.linear_gradient.p1.x, paint.u.linear_gradient.p1.x / 65535.f,
paint.u.linear_gradient.p1.y, paint.u.linear_gradient.p1.y / 65535.f,
paint.u.linear_gradient.p2.x, paint.u.linear_gradient.p2.x / 65535.f,
paint.u.linear_gradient.p2.y); paint.u.linear_gradient.p2.y / 65535.f);
} }
break; break;
case FT_COLR_PAINTFORMAT_RADIAL_GRADIENT: case FT_COLR_PAINTFORMAT_RADIAL_GRADIENT:
@ -218,12 +218,12 @@ _hb_ft_paint (FT_OpaquePaint opaque_paint,
}; };
paint_funcs->radial_gradient (paint_data, &cl, paint_funcs->radial_gradient (paint_data, &cl,
paint.u.radial_gradient.c0.x, paint.u.radial_gradient.c0.x / 65535.f,
paint.u.radial_gradient.c0.y, paint.u.radial_gradient.c0.y / 65535.f,
paint.u.radial_gradient.r0, (paint.u.radial_gradient.r0 / 65535.f),
paint.u.radial_gradient.c1.x, paint.u.radial_gradient.c1.x / 65535.f,
paint.u.radial_gradient.c1.y, paint.u.radial_gradient.c1.y / 65535.f,
paint.u.radial_gradient.r1); (paint.u.radial_gradient.r1 / 65535.f));
} }
break; break;
case FT_COLR_PAINTFORMAT_SWEEP_GRADIENT: case FT_COLR_PAINTFORMAT_SWEEP_GRADIENT:
@ -236,8 +236,8 @@ _hb_ft_paint (FT_OpaquePaint opaque_paint,
}; };
paint_funcs->sweep_gradient (paint_data, &cl, paint_funcs->sweep_gradient (paint_data, &cl,
paint.u.sweep_gradient.center.x, paint.u.sweep_gradient.center.x / 65535.f,
paint.u.sweep_gradient.center.y, paint.u.sweep_gradient.center.y / 65535.f,
(paint.u.sweep_gradient.start_angle / 65536.f + 1) * (float) M_PI, (paint.u.sweep_gradient.start_angle / 65536.f + 1) * (float) M_PI,
(paint.u.sweep_gradient.end_angle / 65536.f + 1) * (float) M_PI); (paint.u.sweep_gradient.end_angle / 65536.f + 1) * (float) M_PI);
} }