MewPurPur / GodSVG

An application in early development for creating simple vector graphics. Built in Godot.
https://godsvg.com
MIT License
1.06k stars 48 forks source link

Attributes get wrongly added, as if user created new tag #729

Closed Kiisu-Master closed 1 month ago

Kiisu-Master commented 1 month ago

MRP

<svg width="8" height="8" xmlns="http://www.w3.org/2000/svg">
    <circle/>
</svg>

will turn into

<svg width="8" height="8" xmlns="http://www.w3.org/2000/svg">
    <circle r="1"/>
</svg>

Proposed solution

Separate _init() from user added tag setup.

Full issue

All supported tags:

<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg">
    <circle/>
    <rect/>
    <line/>
    <ellipse/>
    <path/>
</svg>

currently turns into:

<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg">
    <circle r="1"/>
    <rect width="1" height="1"/>
    <line/>
    <ellipse rx="1" ry="1"/>
    <path d="M0 0"/>
</svg>