jmathanim
jmathanim copied to clipboard
JMLinearGradient & JMRadialGradient not working properly
Only show one of the colors(stop color) added.
https://github.com/davidgutierrezrubio/jmathanim/assets/46339813/0e79a2af-60ab-4f25-a38e-93fe59da740a
Are you trying to import a SVG with gradients? Unfortunately, JMathAnim, cannot yet import some SVG features as gradients. I will mark to include this feature in the next version.
Thank you for your quick response. The problem is the coordinates system: the cx,cy,r(or x1 x2 y1 y2) can't transformed as the shape. new JMRadialGradient(cx, cy, r)->new JMRadialGradient(cx', cy', r'). I don't know cx', cy',r'.
When defining a JMRadialGradient (or linear) by default the flag relativeToShape is set to false, which means that gradient coordinartes are computed relative to screen not shape. If you wan to change this behaviour, use the method .setRelativeToShape(true) to the created gradient.
Anyway, to be able to import this svg, JMathAnim still needs to implement proper parsing of SVG <radialGradient> and <linearGradient> tags and also the