servo / pathfinder

A fast, practical GPU rasterizer for fonts and vector graphics
Apache License 2.0
3.6k stars 201 forks source link

Repeat/reflect wrap modes do not work correctly for radial gradients #393

Closed Herschel closed 4 years ago

Herschel commented 4 years ago

SVG:

<svg width="400" height="400" xmlns="http://www.w3.org/2000/svg">

    <radialGradient id="gradient"
                    spreadMethod="repeat"
                    cx="200" cy="200" r="10"
                    gradientUnits="userSpaceOnUse">
      <stop offset="0%"  stop-color="#ff0000"/>
      <stop offset="100%" stop-color="#000000"/>
    </radialGradient>

  <rect fill="url(#gradient)"
        x="0" y="0" width="400" height="400"/>
</svg>

Pathfinder result:

Screen Shot 2020-07-15 at 1 43 40 AM

Expected result:

Screen Shot 2020-07-15 at 1 49 17 AM

Linear gradients work as expected.

Revision f62f853 MacBook AIR 2017 Intel HD 615 Also seen on Windows