From b3bb7ebaf476eff1aebde2ba0d3b54e57dd9e63d Mon Sep 17 00:00:00 2001 From: dhrname Date: Tue, 20 Oct 2015 22:51:25 +0900 Subject: [PATCH] Lighten a setFrame method --- org/w3c/dom/smil.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/org/w3c/dom/smil.js b/org/w3c/dom/smil.js index a8fa7fb..7e0dca9 100644 --- a/org/w3c/dom/smil.js +++ b/org/w3c/dom/smil.js @@ -1261,7 +1261,8 @@ base("$frame").up("$svgEvent").mix( { /*スケジュールに記録しておいたものを実行して、イベントを発火 * また、発火した場合は記録から取り除いて、次回から再び発火しないようにする*/ var obj = this.first, - cobj = obj; + cobj = obj, + floor = Math.floor; while(obj) { var frame = obj.frame, target = obj.target; @@ -1272,7 +1273,7 @@ base("$frame").up("$svgEvent").mix( { if ( (obj.eventType === "repeat") && (obj.count < obj.limit) ) { /*リピートイベントが、リピート制限内である場合*/ /*numの段階で、何回リピートしたかを求める*/ - evt.detail = obj.count += Math.floor( (num - frame) / obj.simpleDuration); + evt.detail = obj.count += floor( (num - frame) / obj.simpleDuration); cobj = obj; } else { /*ポインタの連結を変更することで、リストからobj を除去*/ -- 2.11.0