changeset 647:492da72e6537

Add image tag support.
author wycc
date Thu, 29 Jul 2010 00:15:19 +0800
parents 3a1e80de44ff
children 1748dce31cdb
files nodejs/logo.png nodejs/svg.js nodejs/test.svg
diffstat 3 files changed, 19 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
Binary file nodejs/logo.png has changed
--- a/nodejs/svg.js	Thu Jul 29 00:12:18 2010 +0800
+++ b/nodejs/svg.js	Thu Jul 29 00:15:19 2010 +0800
@@ -207,10 +207,13 @@
 
 	if (ref == null) return;
 	sys.puts(ref);
-	if (ref.substr(0,7) != "file://") {
+	if (ref.substr(0,7) == "file://") {
+	    ref = ref.substring(7);
+	} else if (ref.substr(0,5)=="file:") {
+	    ref = ref.substring(5);
+	} else {
 	    return;
 	}
-	ref = ref.substring(7);
 	sys.puts("Load image "+ref);
 	var w;
 	var h;
--- a/nodejs/test.svg	Thu Jul 29 00:12:18 2010 +0800
+++ b/nodejs/test.svg	Thu Jul 29 00:15:19 2010 +0800
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <!-- Created with Inkscape (http://www.inkscape.org/) -->
+
 <svg
    xmlns:ns0="http://madbutterfly.sourceforge.net/DTD/madbutterfly.dtd"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
@@ -14,8 +15,8 @@
    height="480"
    id="svg2"
    sodipodi:version="0.32"
-   inkscape:version="0.46"
-   sodipodi:docname="list.svg"
+   inkscape:version="0.47+devel r9312"
+   sodipodi:docname="test.svg"
    version="1.0"
    inkscape:output_extension="org.inkscape.output.svg.inkscape">
   <sodipodi:namedview
@@ -34,10 +35,11 @@
      inkscape:document-units="px"
      inkscape:current-layer="layer4"
      showgrid="false"
-     inkscape:window-width="1024"
-     inkscape:window-height="768"
+     inkscape:window-width="1347"
+     inkscape:window-height="894"
      inkscape:window-x="0"
-     inkscape:window-y="0" />
+     inkscape:window-y="25"
+     inkscape:window-maximized="0" />
   <defs
      id="defs4">
     <linearGradient
@@ -301,5 +303,12 @@
          rx="10"
          ry="10" />
     </g>
+    <image
+       y="78.788635"
+       x="34.986565"
+       id="image3033"
+       xlink:href="file:logo.png"
+       height="37"
+       width="46" />
   </g>
 </svg>