[Solved] Picture with SVG

Started by RGPaul, 10 March 2023, 18:04:03

RGPaul

Hey,

I have some trouble getting the Picture Widget to work with SVG. I tried a PNG. That works, but if I use SVG it won't show.
Any idea what might be the problem?

texus

Are you calling setSize on the Picture?
Can you attach the svg file that you are trying to use?

Maybe it uses something that isn't supported (TGUI uses nanosvg which only supports simple SVGs and doesn't implement the entire SVG standard).
Can you try with loading the sample drawing.svg in the Picture (which is known to render correctly)?

RGPaul

Okay your provided svg works. Must be something with my svg then.

RGPaul

My SVG isn't working because I use a gradient. I updated the nanosvg dependency in tgui. After that my SVG works. Maybe you could update nanosvg in tgui to the latest version?

texus

The nanosvg version has been updated.

RGPaul