svnno****@sourc*****
svnno****@sourc*****
2011年 2月 16日 (水) 23:22:53 JST
Revision: 2412 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2412 Author: dhrname Date: 2011-02-16 23:22:53 +0900 (Wed, 16 Feb 2011) Log Message: ----------- NAIBU._setPaint関数のparseFloatを記号に変えることで最適化 Modified Paths: -------------- branches/07x/071/org/w3c/dom/svg.js Modified: branches/07x/071/org/w3c/dom/svg.js =================================================================== --- branches/07x/071/org/w3c/dom/svg.js 2011-02-16 12:46:18 UTC (rev 2411) +++ branches/07x/071/org/w3c/dom/svg.js 2011-02-16 14:22:53 UTC (rev 2412) @@ -2245,7 +2245,7 @@ } var fc = fill.rgbColor, num = /*CSSPrimitiveValue.CSS_NUMBER*/ 1; fillElement.setAttribute("color", "rgb(" +fc.red.getFloatValue(num)+ "," +fc.green.getFloatValue(num)+ "," +fc.blue.getFloatValue(num)+ ")"); - var fillOpacity = parseFloat(style.getPropertyValue("fill-opacity")) * style._list._opacity; //opacityを掛け合わせる + var fillOpacity = +(style.getPropertyValue("fill-opacity")) * style._list._opacity; //opacityを掛け合わせる if (fillOpacity < 1) { fillElement.setAttribute("opacity", fillOpacity+""); } @@ -2299,7 +2299,7 @@ if (!stroke.uri) { var fc = stroke.rgbColor, num = /*CSSPrimitiveValue.CSS_NUMBER*/ 1; strokeElement.setAttribute("color", "rgb(" +fc.red.getFloatValue(num)+ "," +fc.green.getFloatValue(num)+ "," +fc.blue.getFloatValue(num)+ ")"); - var strokeOpacity = parseFloat(style.getPropertyValue("stroke-opacity")) * parseFloat(style.getPropertyValue("opacity")); //opacityを掛け合わせる + var strokeOpacity = +(style.getPropertyValue("stroke-opacity")) * (+(style.getPropertyValue("opacity"))); //opacityを掛け合わせる if (swx < 1) { strokeOpacity *= swx; //太さが1px未満なら色を薄くする } @@ -2320,7 +2320,7 @@ if (tsd.indexOf(",") > 0) { //コンマ区切りの文字列の場合 var strs = tsd.split(","); for (var i = 0, sli = strs.length; i < sli; ++i) { - strs[i] = Math.ceil(parseFloat(strs[i]) / parseFloat(style.getPropertyValue("stroke-width"))); //精密ではないので注意 + strs[i] = Math.ceil(+(strs[i]) / parseFloat(style.getPropertyValue("stroke-width"))); //精密ではないので注意 } var strokedasharray = strs.join(" "); if (strs.length % 2 === 1) {