# HG changeset patch # User wycc # Date 1302291663 -28800 # Node ID 13e126941bdd8fbcb796deaf70bdab6c5a7edc36 # Parent bd3d5ac8e74857fca0bad4446cf5c5073bddcec4 The scribbo may set the duplicated-src to itself. We work around it here. However, we should modify the scribbo to fix it. diff -r bd3d5ac8e748 -r 13e126941bdd nodejs/svg.js --- a/nodejs/svg.js Sat Apr 09 03:39:57 2011 +0800 +++ b/nodejs/svg.js Sat Apr 09 03:41:03 2011 +0800 @@ -976,16 +976,15 @@ attr = n.attr('duplicate-src'); if (attr) { var id = attr.value(); - var orign = this.mb_rt.mbnames[id].node; - sys.puts("xxxxxxxxxxxxxx"); - var nw = getInteger(orign,'width'); - var nh = getInteger(orign,'height'); - sys.puts("nw="+nw); - sys.puts("nh="+nh); - sys.puts("w="+w); - sys.puts("h="+h); - tcoord.sx *= w/nw; - tcoord.sy *= h/nh; + var src = this.mb_rt.mbnames[id]; + if (src != null) { + var orign = src.node; + sys.puts("xxxxxxxxxxxxxx"); + var nw = getInteger(orign,'width'); + var nh = getInteger(orign,'height'); + tcoord.sx *= w/nw; + tcoord.sy *= h/nh; + } }