BigBadaboom / androidsvg

SVG rendering library for Android
http://bigbadaboom.github.io/androidsvg/
Apache License 2.0
1.21k stars 231 forks source link

Support fx, fy and fr attributes of <radialGradient> #257

Closed BigBadaboom closed 2 years ago

BigBadaboom commented 2 years ago

This is now possible from Android API 31 onwards due to the addition of a the new RadialGradient constructor that takes endX, endY, and endRadius parameters.

fx and fy are in SVG 1.1. The fr attribute is a new addition to SVG 2.

BigBadaboom commented 2 years ago

Fixed.

BigBadaboom commented 2 years ago

For sample gradient:

      <radialGradient id="MyGradient" gradientUnits="userSpaceOnUse"
                      cx="250" cy="200" r="400" fx="550" fy="200">
        <stop offset="0%" stop-color="lime" />
        <stop offset="30%" stop-color="yellow" />
        <stop offset="80%" stop-color="red" />
      </radialGradient>

Before (v1.4)

before

After (v1.5 on Android 12+)

after