svnno****@sourc*****
svnno****@sourc*****
2011年 6月 17日 (金) 22:59:10 JST
Revision: 2776 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2776 Author: dhrname Date: 2011-06-17 22:59:10 +0900 (Fri, 17 Jun 2011) Log Message: ----------- SVGAnimateMotionElementにおいて、現在の時間配分に関する問題について修正 Modified Paths: -------------- branches/08x/080/org/w3c/dom/svg.js Modified: branches/08x/080/org/w3c/dom/svg.js =================================================================== --- branches/08x/080/org/w3c/dom/svg.js 2011-06-17 13:50:34 UTC (rev 2775) +++ branches/08x/080/org/w3c/dom/svg.js 2011-06-17 13:59:10 UTC (rev 2776) @@ -5476,23 +5476,8 @@ tgsd = null; return; } - if ((n !== -1) && (d !== 0) && (tg <= d)) { - ii = Math.floor((tg*n) / d); - if (ii === n) { //iiが境い目のときは、n-2を適用 - ii -= 1; - } - } else { - return; - } - if (tar._keyTimes) { - di = (tar._keyTimes[ii+1] - tar._keyTimes[ii]) * d; - ti = tar._keyTimes[ii]; - } else { - di = d / n; //keyTimesがなければ均等に時間を配分しておく - ti = ii / n; - } if (tpn) { //path属性が指定されていた場合、tpnは属性値となる - var st = (tpn.getTotalLength() / tgsd) * _tar.getCurrentTime() / 125 * 0.8, + var st = (tpn.getTotalLength() / tgsd) * d / 125, p = tpn.getPointAtLength(st), trans = _tar.targetElement.transform; p = p.matrixTransform(_tar.targetElement.getScreenCTM()); @@ -5506,6 +5491,21 @@ evtt = base = trans = st = p = null; } else if (tar._valueList) { var total = 0; + if ((n !== -1) && (d !== 0) && (tg <= d)) { + ii = Math.floor((tg*n) / d); + if (ii === n) { //iiが境い目のときは、n-2を適用 + ii -= 1; + } + } else { + return; + } + if (tar._keyTimes) { + di = (tar._keyTimes[ii+1] - tar._keyTimes[ii]) * d; + ti = tar._keyTimes[ii]; + } else { + di = d / n; //keyTimesがなければ均等に時間を配分しておく + ti = ii / n; + } for (var i=1, tav=tar._valueList, tvli=tav.length;i<tvli;i+=2) { total += Math.sqrt(Math.pow(tav[i][1] - tav[i][0], 2) + Math.pow(tav[i-1][1] - tav[i-1][0], 2)); }