svnno****@sourc*****
svnno****@sourc*****
2010年 9月 25日 (土) 23:17:54 JST
Revision: 2017 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2017 Author: dhrname Date: 2010-09-25 23:17:54 +0900 (Sat, 25 Sep 2010) Log Message: ----------- rect要素などのバグを修正 Modified Paths: -------------- branches/06x/061/org/w3c/dom/svg.js Modified: branches/06x/061/org/w3c/dom/svg.js =================================================================== --- branches/06x/061/org/w3c/dom/svg.js 2010-09-25 11:58:00 UTC (rev 2016) +++ branches/06x/061/org/w3c/dom/svg.js 2010-09-25 14:17:54 UTC (rev 2017) @@ -180,7 +180,7 @@ } else if (degli <= 2) { var degz = _parseFloat(deg[0]); if (com === "translate") { - s.setTranslate(degz, _parseFloat(deg[1] || deg[0])); + s.setTranslate(degz, _parseFloat(deg[1] || 0)); } else if (com === "scale") { s.setScale(degz, _parseFloat(deg[1] || deg[0])); } else if (com === "rotate") { @@ -1618,8 +1618,8 @@ /*整数にしているのは、VMLの設計上、小数点を扱えないときがあるため*/ var x = parseInt(matrix.a * this.x + matrix.c * this.y + matrix.e, 10); var y = parseInt(matrix.b * this.x + matrix.d * this.y + matrix.f, 10); - if (-1 < x && x < 1) {x=1;} - if (-1 < y && y < 1) {y=1;} + if ((-1 < x) && (x < 1)) {x=1;} + if ((-1 < y) && (y < 1)) {y=1;} var s = new SVGPoint(); s.x = x; s.y = y; @@ -2796,10 +2796,10 @@ tnext = tpar = null; tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt) { var tar = evt.target; - var rx = tar.hasAttributeNS(null, "rx"), ry = tar.hasAttributeNS(null, "ry"); + var rx = tar.getAttributeNS(null, "rx"), ry = tar.getAttributeNS(null, "ry"); var x = tar.x.baseVal.value, y = tar.y.baseVal.value, xw = x + tar.width.baseVal.value, yh = y + tar.height.baseVal.value; var list; - if (rx || ry) { + if ((rx || ry) && (rx !== "0") && (ry !== "0")) { var thrx = tar.rx.baseVal, thry = tar.ry.baseVal; thrx.value = rx ? thrx.value : thry.value; thry.value = ry ? thry.value : thrx.value; @@ -2837,12 +2837,12 @@ } var dat = list.join(" "); //VMLに結び付けていく - var ele = tar._tar, vi = tar.ownerDocument.documentElement.viewport; - var w = vi.width, h = vi.height; + var ele = tar._tar, vi = tar.ownerDocument.documentElement; + var w = vi.width.baseVal.value, h = vi.height.baseVal.value; ele.path = dat; ele.coordsize = w + " " + h; NAIBU._setPaint(tar, ctm); - evt = tar = list = dat = ele = null; + evt = tar = list = dat = ele = vi = null; }, false); evt = tar = null; }, false);