svnno****@sourc*****
svnno****@sourc*****
2010年 9月 22日 (水) 21:02:35 JST
Revision: 2009 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2009 Author: dhrname Date: 2010-09-22 21:02:35 +0900 (Wed, 22 Sep 2010) Log Message: ----------- SVGAnimateColorElementの修正 Modified Paths: -------------- branches/06x/061/org/w3c/dom/css.js branches/06x/061/org/w3c/dom/svg.js Modified: branches/06x/061/org/w3c/dom/css.js =================================================================== --- branches/06x/061/org/w3c/dom/css.js 2010-09-22 11:33:43 UTC (rev 2008) +++ branches/06x/061/org/w3c/dom/css.js 2010-09-22 12:02:35 UTC (rev 2009) @@ -703,7 +703,7 @@ tar._strokeElement = document.createElement("v:stroke"); el.appendChild(tar._strokeElement); } - var fillElement = tar._fillElementvar, strokeElement = tar._strokeElement; + var fillElement = tar._fillElement, strokeElement = tar._strokeElement; setProp.call(s, propertyName, value, priority); if (propertyName === "fill-opacity") { var fillOpacity = parseFloat(value) * style._list._opacity; //opacityを掛け合わせる Modified: branches/06x/061/org/w3c/dom/svg.js =================================================================== --- branches/06x/061/org/w3c/dom/svg.js 2010-09-22 11:33:43 UTC (rev 2008) +++ branches/06x/061/org/w3c/dom/svg.js 2010-09-22 12:02:35 UTC (rev 2009) @@ -4440,9 +4440,6 @@ tta.baseVal = tar.ownerDocument.documentElement.createSVGLength(); } else if (base instanceof SVGRect) { tta.baseVal = tar.ownerDocument.documentElement.createSVGRect(); - } else if (base instanceof SVGTransformList) { - tta.baseVal = new SVGTransformList(); - tta.baseVal.initialize(tar.ownerDocument.documentElement.createSVGTransform()); } /*setAttrbute(NS)メソッドはDOM属性を書き換えるため利用しない。 * @@ -4509,7 +4506,7 @@ */ trans.animVal = new SVGTransformList(); trans.animVal.initialize(trans.baseVal.createSVGTransformFromMatrix(trans.baseVal.getItem(0).matrix)); - trans.animVal.setItem(tar.ownerDocument.documentElement.createSVGTransform()); + trans.animVal.appendItem(tar.ownerDocument.documentElement.createSVGTransform()); tar._frame = function() { var _tar = tar, tpn = _tar._path; if (!!tpn) { @@ -4568,7 +4565,7 @@ tar._frame = function() { var _tar = tar, to = new SVGColor(), from = new SVGColor(); var n = _tar._values.length - 1, t = _tar.getCurrentTime(), d = _tar.getSimpleDuration(), i = Math.floor((t*n) / d); - to.setRGBColor(_tar._valuse[i+1]); + to.setRGBColor(_tar._values[i+1]); from.setRGBColor(_tar._values[i]); if (!!!_tar._keyTimes) { var ti = d / n, ki =ti; @@ -4581,7 +4578,7 @@ } var tc = to.rgbColor, fc = from.rgbColor, num = CSSPrimitiveValue.CSS_NUMBER, di = (t - ti) / ki; var r = fc.red.getFloatValue(num) + (tc.red.getFloatValue(num) - fc.red.getFloatValue(num)) * di; - var g = fc.green.getFloatValue(num) + (tc.green.getFloatValue(num) - fc.blue.getFloatValue(num)) * di; + var g = fc.green.getFloatValue(num) + (tc.green.getFloatValue(num) - fc.green.getFloatValue(num)) * di; var b = fc.blue.getFloatValue(num) + (tc.blue.getFloatValue(num) - fc.blue.getFloatValue(num)) * di; style.setProperty(attrName, "rgb(" +Math.ceil(r)+ "," +Math.ceil(g)+ "," +Math.ceil(b)+ ")", null); _tar = t = to = from = fc = tc = num = r = g = b = null; @@ -4606,7 +4603,13 @@ SVGAnimationElement.apply(this); NAIBU.Clip[NAIBU.Clip.length] = this; this.addEventListener("beginEvent", function(evt) { - var tar = evt.target; + var tar = evt.target, trans = tar.transform; + /*アニメーション中に変化すべき値をanimValプロパティに入力して、 + *baseValと同じような値に設定。 + */ + trans.animVal = new SVGTransformList(); + trans.animVal.initialize(trans.baseVal.createSVGTransformFromMatrix(trans.baseVal.getItem(0).matrix)); + trans.animVal.appendItem(tar.ownerDocument.documentElement.createSVGTransform()); }, false); this.addEventListener("endEvent", function(evt) { var tar = evt.target;