svnno****@sourc*****
svnno****@sourc*****
2010年 5月 23日 (日) 19:27:41 JST
Revision: 1838 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=1838 Author: dhrname Date: 2010-05-23 19:27:41 +0900 (Sun, 23 May 2010) Log Message: ----------- 1, SVGMatrixのmultiplyメソッドで引数の型チェックをできるようにした 2, SVGSVGElementのgetScreenCTMメソッドのキャッシュに関する修正 3, NAIBU.documentの追加 Modified Paths: -------------- branches/ufltima/dom/svg.js Modified: branches/ufltima/dom/svg.js =================================================================== --- branches/ufltima/dom/svg.js 2010-05-22 14:52:15 UTC (rev 1837) +++ branches/ufltima/dom/svg.js 2010-05-23 10:27:41 UTC (rev 1838) @@ -1083,7 +1083,9 @@ } if (!!!vB._isUsed) { //viewBox属性が指定されていなければ this._tx = this._ty = 0; - return this.createSVGMatrix(); + var m = this.createSVGMatrix(); + this._cacheScreenCTM = m; //キャッシュを作っておく + return m; } else { var vbx = vB.x, vby = vB.y, vbw = vB.width, vbh = vB.height; var rw = vw / vbw, rh = vh / vbh; @@ -1293,7 +1295,7 @@ /*responseXMLを使うと、時々、空のデータを返すことがあるため(原因は不明)、 *ここでは、responseTextを用いる */ - var doc = new ActiveXObject("MSXML2.DomDocument"); + var doc = NAIBU.document; var dew = new Date(); str = xmlhttp.responseText.replace(/!DOCTYPE/,"!--").replace(/(dtd">|\]>)/,"-->"); doc.loadXML(str); @@ -1434,6 +1436,9 @@ */ /*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)) { + throw (new Error("引数の値がNumber型ではありません")); + } s.a = this.a * m.a + this.c * m.b; s.b = this.b * m.a + this.d * m.b; s.c = this.a * m.c + this.c * m.d; @@ -3844,6 +3849,7 @@ } } NAIBU.xmlhttp = xmlhttp; + NAIBU.document = new ActiveXObject("MSXML2.DomDocument"); if (!document.namespaces["v"]) { document.namespaces.add("v","urn:schemas-microsoft-com:vml"); document.namespaces.add("o","urn:schemas-microsoft-com:office:office");