mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-27 15:36:16 +01:00
12 lines
No EOL
388 B
Text
12 lines
No EOL
388 B
Text
function svg_parse(xmlStr) {
|
|
|
|
if(!is_struct(xmlStr)) return noone;
|
|
if(!struct_has(xmlStr, "children")) return noone;
|
|
if(struct_try_get(xmlStr, "type") != "root") return noone;
|
|
if(array_empty(xmlStr.children)) return noone;
|
|
|
|
var svg_object = xmlStr.children[0];
|
|
if(struct_try_get(svg_object, "type") != "svg") return noone;
|
|
|
|
return new SVG().setContent(svg_object);
|
|
} |