svnno****@sourc*****
svnno****@sourc*****
2009年 9月 14日 (月) 21:24:06 JST
Revision: 1245 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=1245 Author: dhrname Date: 2009-09-14 21:24:06 +0900 (Mon, 14 Sep 2009) Log Message: ----------- fill、stroke要素の生成を元に戻す Modified Paths: -------------- branches/05x/051/sie.js Modified: branches/05x/051/sie.js =================================================================== --- branches/05x/051/sie.js 2009-09-13 14:41:11 UTC (rev 1244) +++ branches/05x/051/sie.js 2009-09-14 12:24:06 UTC (rev 1245) @@ -646,22 +646,20 @@ dat = preCom = x = y = x0 = y0 = dx = dy = tma = tmb = tmc = tmd = tme = tmf = null; //解放 if(Nnenn) { Nnenn = false; - this.setAttributeNS("http://www.w3.org/svg/2000","stroke-width", "10px"); - this.setAttributeNS("http://www.w3.org/svg/2000","fill", "red"); + this.setAttributeNS("http://www.w3.org/svg/2000","stroke", "red"); } } catch(e) {stlog.add(e,372);} } Nnenn = true; STPath.prototype.setAttributeNS = function ( /*string*/ namespaceURI, /*string*/ name, /*string*/ value) { try{ //以下でfill,storke要素のリセットが必要 - if (this.tar.getElementsByTagName("fill").length > 0) { - this.tar.removeChild(this.paint.fillElement); + var tgebtfill = this.tar.getElementsByTagName("fill"), tgebtstroke = this.tar.getElementsByTagName("stroke"); + if (tgebtfill.length > 0) { + this.tar.removeChild(tgebtfill[0]); } - this.paint.fillElement = document.createElement("v:fill"); - if (this.tar.getElementsByTagName("stroke").length > 0) { - this.tar.removeChild(this.paint.strokeElement); + if (tgebtstroke.length > 0) { + this.tar.removeChild(tgebtstroke[0]); } - this.paint.strokeElement = document.createElement("v:stroke"); if (this.paint.defaults[name] !== void 0) { //スタイルで定義されていれば name = name.replace(/fill-/, "fill").replace(/stroke-/, "stroke"); this.paint[name] = value; @@ -989,12 +987,6 @@ name = null; } } - if (this.fill !== "none") { - this.fillElement = document.createElement("v:fill"); - } - if (this.stroke !== "none") { - this.strokeElement = document.createElement("v:stroke"); - } } return this; } @@ -1057,7 +1049,7 @@ if (this.fill === "none") { el.filled = "false"; } else { - var fillElement = this.fillElement; + var fillElement = document.createElement("v:fill");; var isRadial = false; try { if (this._urlreg.test(this.fill)) { //fill属性の値がurl(#id)ならば、idを設定したグラデーション関連要素を呼び出す @@ -1080,7 +1072,7 @@ if (this.stroke === "none") { el.stroked = "false"; } else { - var strokeElement = this.strokeElement; + var strokeElement = document.createElement("v:stroke");; try { var sw = new STLength(this.strokewidth, Math.sqrt((w*w + h*h) / 2)); var swx = sw.value * Math.sqrt(Math.abs(matrix.determinant()));