svnno****@sourc*****
svnno****@sourc*****
2011年 1月 30日 (日) 21:05:05 JST
Revision: 2344 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2344 Author: dhrname Date: 2011-01-30 21:05:05 +0900 (Sun, 30 Jan 2011) Log Message: ----------- SVGMatrixのrotateFromVectorメソッドがラジアンを間違えていたため修正 Modified Paths: -------------- branches/06x/069/org/w3c/dom/svg.js Modified: branches/06x/069/org/w3c/dom/svg.js =================================================================== --- branches/06x/069/org/w3c/dom/svg.js 2011-01-29 11:08:11 UTC (rev 2343) +++ branches/06x/069/org/w3c/dom/svg.js 2011-01-30 12:05:05 UTC (rev 2344) @@ -1820,17 +1820,21 @@ m.c = -m.b; m.d = m.a; var s = this.multiply(m); - m = null; + m = rad = null; return s; }, //座標(x, y)と原点の角度の分だけ、回転する /*SVGMatrix*/ rotateFromVector : function(/*float*/ x, /*float*/ y ) { - if (x === 0 || y === 0) { + if ((x === 0) || (y === 0) || !isFinite(x) || !isFinite(y)) { throw (new SVGException(SVGException.SVG_INVALID_VALUE_ERR)) } - var m = this.rotate(Math.atan2(y, x)); + var m = new SVGMatrix(), rad = Math.atan2(y, x); + m.a = Math.cos(rad); + m.b = Math.sin(rad); + m.c = -m.b; + m.d = m.a; var s = this.multiply(m); - m = null; + m = rad = null; return s; }, /*SVGMatrix*/ flipX : function() {