I would like to report a possible issue of SVG path.
When we set a gradient texture (horizontal, vertical, radial, or sweep gradients) on an SVG path shape, it doesn’t work. It works with other types of the Shape elements, but not the SVG path. The SVG path is a closed path, so it should be able to be filled with color.
I would like to why does it not work and is there any solution?
I need the gradient texture can be applied to an SVG path shape.
I tried it (just took one of the rectangles) and indeed, gradient fill is not working.
I also tried to go with numbers without the decimals, but that wouldn’t fill correctly either.
Can’t reproduce it in other shapes, so one of the elements you used is probably messing it up…
Maybe the control points of the bezier curves somehow?
What is the right way to write an SVG path? I saw some paths are written as a pair of coordinate (… , …) and some others are using space and dash (like the example I sent).
As far as I know both comma and space work, but I myself find it easier to read with the comma’s.
I think you already know, but you can try out your code here
They also explain what each thing you type in does, so that helps sometimes and you can also check that comma and space in the coordinates does the same thing.
I finally figured it out why my SVG Path shape didn’t show the gradient color.
KLWP did apply the gradient color to the shape. Why it didn’t show up is because of the difference between the shape size (dimension) and the path size (dimension).
In order to be able to show the gradient color, we need to have an SVG Path with a size of 1.5× of the shape size. Let say we create a 80×80 shape in a preset, so we need an SVG Path with a size of 120×120 pixels (120 is equal to 80 multiplied by 1.5).
In reverse, let say we have an SVG Path in 240×240 pixels, so we have to create a shape in the preset with its size set to 160×160 (160 is equal to 240 divided by 1.5).
I attach the screenshots from my investigation, we can see that the SVG path shape is now showing gradient color.
Hope this helps everyone else who has a similar issue with gradient texture in SVG Path shape.