svnno****@sourc*****
svnno****@sourc*****
2010年 10月 18日 (月) 20:44:23 JST
Revision: 2063 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2063 Author: dhrname Date: 2010-10-18 20:44:23 +0900 (Mon, 18 Oct 2010) Log Message: ----------- NAIBU._setPaintの修正 Modified Paths: -------------- branches/06x/061/org/w3c/dom/svg.js Modified: branches/06x/061/org/w3c/dom/svg.js =================================================================== --- branches/06x/061/org/w3c/dom/svg.js 2010-10-17 14:21:58 UTC (rev 2062) +++ branches/06x/061/org/w3c/dom/svg.js 2010-10-18 11:44:23 UTC (rev 2063) @@ -2136,7 +2136,13 @@ /*再度、設定。css.jsのsetPropertyを参照*/ style.setProperty("color", style.getPropertyValue("color")); } - var fillElement = !!tar._fillElement ? tar._fillElement : document.createElement("v:fill"); + if (!!tar._fillElement) { + var fillElement = tar._fillElement; + /*あらかじめ消しおかないと、効果が出ない*/ + el.removeChild(fillElement); + } else { + var fillElement = document.createElement("v:fill"); + } 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を掛け合わせる @@ -2147,8 +2153,6 @@ el.appendChild(fillElement); tar._fillElement = fillElement; //キャッシュを作る } else { - /*あらかじめ消しおかないと、効果が出ない*/ - el.removeChild(fillElement); el.appendChild(fillElement); } fc = fillOpacity = null; @@ -2177,7 +2181,12 @@ /*再度、設定。css.jsのsetPropertyを参照*/ style.setProperty("color", style.getPropertyValue("color")); } - var strokeElement = !!tar._strokeElement ? tar._strokeElement : document.createElement("v:stroke"); + if (!!tar._strokeElement) { + var strokeElement = tar._strokeElement; + el.removeChild(strokeElement); + } else { + var strokeElement = document.createElement("v:stroke"); + } var sgsw = style.getPropertyCSSValue("stroke-width"), w = tod.documentElement.viewport.width, h = tod.documentElement.viewport.height; sgsw._percent = Math.sqrt((w*w + h*h) / 2); var swx = sgsw.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) * Math.sqrt(Math.abs(matrix._determinant())); @@ -2221,8 +2230,7 @@ el.appendChild(strokeElement); tar._strokeElement = strokeElement; } else { - el.removeChild(fillElement); - el.appendChild(fillElement); + el.appendChild(strokeElement); } tsd = null; } else {