[hb-draw] Fix MSVC warning

warning C4305: 'initializing': truncation from 'double' to 'float'
This commit is contained in:
Khaled Hosny 2023-01-21 03:40:09 +02:00 committed by خالد حسني (Khaled Hosny)
parent e1a0705128
commit c08e5d094a
2 changed files with 5 additions and 5 deletions

View File

@ -526,8 +526,8 @@ _hb_cairo_add_sweep_gradient_patches1 (float cx, float cy, float radius,
C0 = _hb_cairo_sum (A, _hb_cairo_scale (U, _hb_cairo_dot (_hb_cairo_difference (p0, A), p0) / _hb_cairo_dot (U, p0))); C0 = _hb_cairo_sum (A, _hb_cairo_scale (U, _hb_cairo_dot (_hb_cairo_difference (p0, A), p0) / _hb_cairo_dot (U, p0)));
C1 = _hb_cairo_sum (A, _hb_cairo_scale (U, _hb_cairo_dot (_hb_cairo_difference (p1, A), p1) / _hb_cairo_dot (U, p1))); C1 = _hb_cairo_sum (A, _hb_cairo_scale (U, _hb_cairo_dot (_hb_cairo_difference (p1, A), p1) / _hb_cairo_dot (U, p1)));
patch.c0 = _hb_cairo_sum (center, _hb_cairo_scale (_hb_cairo_sum (C0, _hb_cairo_scale (_hb_cairo_difference (C0, p0), 0.33333)), radius)); patch.c0 = _hb_cairo_sum (center, _hb_cairo_scale (_hb_cairo_sum (C0, _hb_cairo_scale (_hb_cairo_difference (C0, p0), 0.33333f)), radius));
patch.c1 = _hb_cairo_sum (center, _hb_cairo_scale (_hb_cairo_sum (C1, _hb_cairo_scale (_hb_cairo_difference (C1, p1), 0.33333)), radius)); patch.c1 = _hb_cairo_sum (center, _hb_cairo_scale (_hb_cairo_sum (C1, _hb_cairo_scale (_hb_cairo_difference (C1, p1), 0.33333f)), radius));
_hb_cairo_add_patch (pattern, &center, &patch); _hb_cairo_add_patch (pattern, &center, &patch);

View File

@ -326,7 +326,7 @@ typedef struct {
static paint_test_t paint_tests[] = { static paint_test_t paint_tests[] = {
/* COLRv1 */ /* COLRv1 */
{ NOTO_HAND, 0., 10, 0, "hand-10" }, { NOTO_HAND, 0., 10, 0, "hand-10" },
{ NOTO_HAND, 0.2, 10, 0, "hand-10.2" }, { NOTO_HAND, 0.2f,10, 0, "hand-10.2" },
{ TEST_GLYPHS, 0, 6, 0, "test-6" }, // linear gradient { TEST_GLYPHS, 0, 6, 0, "test-6" }, // linear gradient
{ TEST_GLYPHS, 0, 10, 0, "test-10" }, // sweep gradient { TEST_GLYPHS, 0, 10, 0, "test-10" }, // sweep gradient
@ -351,8 +351,8 @@ static paint_test_t paint_tests[] = {
{ BAD_COLRV1, 0, 154, 0, "bad-154" }, // recursion { BAD_COLRV1, 0, 154, 0, "bad-154" }, // recursion
/* COLRv0 */ /* COLRv0 */
{ ROCHER_ABC, 0.3, 1, 0, "rocher-1" }, { ROCHER_ABC, 0.3f, 1, 0, "rocher-1" },
{ ROCHER_ABC, 0.3, 2, 2, "rocher-2" }, { ROCHER_ABC, 0.3f, 2, 2, "rocher-2" },
{ ROCHER_ABC, 0, 3, 200, "rocher-3" }, { ROCHER_ABC, 0, 3, 200, "rocher-3" },
}; };