Mercurial > MadButterfly
diff nodejs/svg.js @ 1422:6fa411fd9549
Commit merged result
author | wycc |
---|---|
date | Wed, 06 Apr 2011 21:35:21 +0800 |
parents | c918b79892ab |
children | 167873cd35c5 |
line wrap: on
line diff
--- a/nodejs/svg.js Wed Apr 06 08:17:00 2011 +0800 +++ b/nodejs/svg.js Wed Apr 06 21:35:21 2011 +0800 @@ -976,16 +976,14 @@ 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 coord = this.mb_rt.mbnames[id]; + if (coord) { + var orign = this.mb_rt.mbnames[id].node; + var nw = getInteger(orign,'width'); + var nh = getInteger(orign,'height'); + tcoord.sx *= w/nw; + tcoord.sy *= h/nh; + } }