diff --git a/tests/draw/svg/test_gradients.py b/tests/draw/svg/test_gradients.py index d57fdf43d..376f47ccc 100644 --- a/tests/draw/svg/test_gradients.py +++ b/tests/draw/svg/test_gradients.py @@ -490,3 +490,34 @@ def test_radial_gradient_reflect(assert_pixels): ''') + + +@assert_no_logs +def test_linear_gradient_opacity(assert_pixels): + assert_pixels(''' + BBBBBBBBBB + BBBBBBBBBB + BBBBBBBBBB + BBBBBBBBBB + BBBBBBBBBB + ssssssssss + ssssssssss + ssssssssss + ssssssssss + ssssssssss + ''', ''' + + + + + + + + + + + ''') diff --git a/weasyprint/svg/defs.py b/weasyprint/svg/defs.py index 3dd13e7b6..85273322c 100644 --- a/weasyprint/svg/defs.py +++ b/weasyprint/svg/defs.py @@ -236,7 +236,7 @@ def draw_gradient(svg, node, gradient, font_size, opacity, stroke): encode = (len(colors) - 1) * (0, 1) bounds = positions[1:-1] sub_functions = ( - group.create_interpolation_function((0, 1), c0, c1, 1) + group.create_interpolation_function((0, 1), [c0], [c1], 1) for c0, c1 in alpha_couples) function = group.create_stitching_function( domain, encode, bounds, sub_functions)