saschagehlich / pixi-svg-graphics

Draws SVG documents on PIXI.Graphics objects
MIT License
55 stars 20 forks source link

gradients not supported? #5

Open makc opened 9 years ago

makc commented 9 years ago

I have this basic svg with the gradient in the rectangle:

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Слой_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
     width="104px" height="640px" viewBox="0 0 104 640" enable-background="new 0 0 104 640" xml:space="preserve">
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="52" y1="393.9754" x2="52" y2="1.6092">
    <stop  offset="0.6019" style="stop-color:#B5F4FF"/>
    <stop  offset="0.7487" style="stop-color:#ACF4FF"/>
    <stop  offset="0.9921" style="stop-color:#92F4FF"/>
    <stop  offset="0.9944" style="stop-color:#92F4FF"/>
</linearGradient>
<rect fill="url(#SVGID_1_)" width="104" height="640"/>
</svg>

What I end up with is this: screen shot 2015-09-04 at 3 39 09

in PIXI.Graphics, and nothing is displayed.

FlorianLudwig commented 9 years ago

@makc there is no easy way to fix this as the PIXI.Graphics API itself does not support gradients.

trusktr commented 7 years ago

It's 2017, gradients are supported in Pixi now.

Rskut commented 5 years ago

It’s 2019, svg consume to much gpu ressouces on mobile devices (5000+ paths)

So im looking for svg to raster with d3js and pixijs combination. Or does pixijs offer a solution for this already?