chenbo007 / svg-edit

Automatically exported from code.google.com/p/svg-edit
0 stars 0 forks source link

Load SVG files from the web into the editor #32

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using XMLHttpRequest, it should be possible to fetch an SVG file from a URL
and populate the SVG canvas.  

This would work great for files created from svg-edit in the first place. 
However, this will cause problems with files created elsewhere because
svg-edit is still fairly basic.  

I'll list three off the top of my head:

1) Lots of online SVG content uses the style attribute (thanks to
Inkscape).  So if we had the following element in an loaded SVG:

<rect style="fill:red" />

And the user selects that rect and changes its fill attribute to blue - the
rect would still show as red because the style attribute takes precedence.

2) If the SVG file references external CSS files or raster images using
relative URLs, svg-edit would not see them

3) If the SVG file is not 'flat', what will happen when the user attempts
to select a group?  Will need to experiment.

One option would be to run the file through a mini-scour in JavaScript (see
http://codedread.com/scour/ ) to get it into a better shape for our editor.

Original issue reported on code.google.com by codedr...@gmail.com on 18 Jun 2009 at 6:42

GoogleCodeExporter commented 9 years ago

Original comment by codedr...@gmail.com on 18 Jun 2009 at 6:43

GoogleCodeExporter commented 9 years ago
Accidentally created a new issue for this with my thoughts on how to avoid 
problems
mentioend above.  Will use Issue 60 to track this and will close this one.

Original comment by codedr...@gmail.com on 8 Jul 2009 at 9:01