svnno****@sourc*****
svnno****@sourc*****
2010年 11月 24日 (水) 22:50:40 JST
Revision: 2173 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2173 Author: dhrname Date: 2010-11-24 22:50:40 +0900 (Wed, 24 Nov 2010) Log Message: ----------- calcMode属性のdiscreteに対応 Modified Paths: -------------- branches/06x/064/org/w3c/dom/svg.js Modified: branches/06x/064/org/w3c/dom/svg.js =================================================================== --- branches/06x/064/org/w3c/dom/svg.js 2010-11-24 13:37:45 UTC (rev 2172) +++ branches/06x/064/org/w3c/dom/svg.js 2010-11-24 13:50:40 UTC (rev 2173) @@ -4784,6 +4784,15 @@ *機械が理解できる形で保管されているvalueの値の配列リスト */ this._valueList = []; + this._isDiscrete = false; + this.addEventListener("DOMAttrModified", function(evt){ + if (evt.eventPhase === Event.BUBBLING_PHASE) { + return; //強制終了させる + } + if ((evt.attrName === "calcMode") && (evt.newValue === "discrete")) { + evt.target._isDiscrete = true; + } + }, false); this.addEventListener("DOMNodeInserted", function(evt){ if (evt.eventPhase === Event.BUBBLING_PHASE) { return; //強制終了させる @@ -4866,7 +4875,11 @@ * 3.4.2 Specifying the simple animation function f(t) *http://www.w3.org/TR/2005/REC-SMIL2-20050107/animation.html#animationNS-SpecifyingAnimationFunction */ - var v = v1 + (v2-v1) * (tg-tar._keyTimes[ii]*d) / di; + if (!tar._isDiscrete) { + var v = v1 + (v2-v1) * (tg-tar._keyTimes[ii]*d) / di; + } else { + var v = v1; + } tanim.newValueSpecifiedUnits(tanim.unitType, v); tta.baseVal = tanim; tanim = null; @@ -4879,9 +4892,12 @@ di = null; } else if (!!CSS2Properties[attrName] || attrName.indexOf("-") > -1) { //スタイルシートのプロパティならば var base = null; - var v1 = tar._valueList[ii], v2 = tar._valueList[ii+1]; - var v = v1 + (v2-v1) * (tg-tar._keyTimes[ii]*d) / d; - ttr.dispatchEvent(evt); + var v1 = tar._valueList[ii].value, v2 = tar._valueList[ii+1].value, di = (tar._keyTimes[ii+1] - tar._keyTimes[ii]) * d; + if (!tar._isDiscrete) { + var v = v1 + (v2-v1) * (tg-tar._keyTimes[ii]*d) / di; + } else { + var v = v1; + } } else if ("animatedPoints" in ttr) { var base = ttr.points; ttr.points = ttr.animatedPoints;