svnno****@sourc*****
svnno****@sourc*****
2011年 1月 19日 (水) 23:20:48 JST
Revision: 2312 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2312 Author: dhrname Date: 2011-01-19 23:20:48 +0900 (Wed, 19 Jan 2011) Log Message: ----------- 1, SVGLengthに関する例外処理のバグの修正 2, SVGMatrixに関する引数に対して、演算可能かどうかをチェックする処理を修正 3, SVGPathElementの処理に関して、配列の組み合わせを見直した Modified Paths: -------------- branches/06x/068/org/w3c/dom/svg.js Modified: branches/06x/068/org/w3c/dom/svg.js =================================================================== --- branches/06x/068/org/w3c/dom/svg.js 2011-01-18 15:01:01 UTC (rev 2311) +++ branches/06x/068/org/w3c/dom/svg.js 2011-01-19 14:20:48 UTC (rev 2312) @@ -519,7 +519,9 @@ */ newValueSpecifiedUnits : function (/*unsigned short*/ unitType, /*float*/ valueInSpecifiedUnits) { var n = 1, _s = ""; //nは各単位から利用単位への変換数値。_sは単位の文字列を表す - if ((unitType === SVGLength.SVG_LENGTHTYPE_NUMBER) || (unitType === SVGLength.SVG_LENGTHTYPE_PX)) { + if (unitType === SVGLength.SVG_LENGTHTYPE_NUMBER) { + } else if (unitType === SVGLength.SVG_LENGTHTYPE_PX) { + _s = "px"; } else if (unitType === SVGLength.SVG_LENGTHTYPE_PERCENTAGE) { n = this._percent; _s = "%" @@ -544,7 +546,7 @@ n = 15; _s = "pc"; } else { - return new DOMException(DOMException.NOT_SUPPORTED_ERR); + throw new DOMException(DOMException.NOT_SUPPORTED_ERR); } this.unitType = unitType; this.value = valueInSpecifiedUnits * n; @@ -1758,7 +1760,7 @@ */ /*SVGMatrix*/ multiply : function(/*SVGMatrix*/ secondMatrix ) { var s = new SVGMatrix(), m = secondMatrix; - if (isNaN(m.a) || isNaN(m.b) || isNaN(m.c) || isNaN(m.d) || isNaN(m.e) || isNaN(m.f)) { + if (!isFinite(m.a) || !isFinite(m.b) || !isFinite(m.c) || !isFinite(m.d) || !isFinite(m.e) || !isFinite(m.f)) { throw (new Error("引数の値がNumber型ではありません")); } s.a = this.a * m.a + this.c * m.b; @@ -2666,13 +2668,10 @@ *[0 0 1 ] [1] */ - dat[dat.length] = _parseInt(ma*ti.x1 + mc*ti.y1 + me, 10); - dat[dat.length] = _parseInt(mb*ti.x1 + md*ti.y1 + mf, 10); - dat[dat.length] = _parseInt(ma*ti.x2 + mc*ti.y2 + me, 10); - dat[dat.length] = _parseInt(mb*ti.x2 + md*ti.y2 + mf, 10); + dat[dat.length] = _parseInt(ma*ti.x1 + mc*ti.y1 + me, 10)+ " " +_parseInt(mb*ti.x1 + md*ti.y1 + mf, 10); + dat[dat.length] = _parseInt(ma*ti.x2 + mc*ti.y2 + me, 10)+ " " +_parseInt(mb*ti.x2 + md*ti.y2 + mf, 10); } - dat[dat.length] = _parseInt(ma*ti.x + mc*ti.y + me, 10); - dat[dat.length] = _parseInt(mb*ti.x + md*ti.y + mf, 10); + dat[dat.length] = _parseInt(ma*ti.x + mc*ti.y + me, 10)+ " " +_parseInt(mb*ti.x + md*ti.y + mf, 10); } } var vi = tar.ownerDocument.documentElement;