SVG drawing issue


#1

The following SVG do not display correctly in the SVG Path Converter of the Projucer
https://upload.wikimedia.org/wikipedia/commons/1/18/Five-pointed_star.svg

<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="255" height="240" viewBox="0 0 51 48">
<title>Five Pointed Star</title>
<path fill="none" stroke="#000" d="m25,1 6,17h18l-14,11 5,17-15-10-15,10 5-17-14-11h18z"/>
</svg>

Using latest develop trunk.

Bug in SVG code ?

Thanks !


#2

Looks like SVG is very broken right now

checking
https://www.w3schools.com/graphics/svg_polygon.asp
https://www.w3schools.com/graphics/svg_polyline.asp

looks very weird


#3

The only issues I can see is that the SVG path converter is always filling the path and closing sub-paths. I’ll add some options to the window that let you toggle these options on/off.


#4

Would be great if the resulting C++ code uses those option as well.

Thanks !


#5

The fact that the path is closed should be retrieved from the SVG not something that is added by the SVG path converter, no ?


#6

Good addition but the issue is still there
Another “star”

<svg xmlns="http://www.w3.org/2000/svg">
<path  d="
M 240.000 260.000
L 263.511 272.361
L 259.021 246.180
L 278.042 227.639
L 251.756 223.820
L 240.000 200.000
L 228.244 223.820
L 201.958 227.639
L 220.979 246.180
L 216.489 272.361
L 240.000 260.000
"/>
</svg>

#7

This is what I’m seeing, is that not correct?


#8

If you only copy starting at M it indeed works
but try copying the whole SVG text it will fail


#9

Well, yes. It says at the top “Paste an SVG path string into the top box”. The text input field expects just a path string but if you drag and drop the SVG file onto the window it should be parsed correctly.


#10

I see.
Some kind of warning would be welcomed :slight_smile:

Thanks !