OSDN Git Service

NAIBU.stop関数の修正をして、フレーム処理から時間処理に再び変更
[sie/sie.git] / org / w3c / dom / svg.js
index 0343dc9..7dc35d7 100644 (file)
@@ -5391,7 +5391,7 @@ NAIBU.Time = {
     }
     NAIBU.stop = setInterval( (function() {
 /*      try{*/
-        var ntc = NAIBU.Time.currentFrame + 1,
+        var ntc = NAIBU.Time.currentFrame,
             nc = NAIBU.Clip,
             s = ntc * 100; //フレーム数ntcをミリ秒数sに変換 (100 = 125 * 0.8)
         if (ntc > NAIBU.Time.Max) {
@@ -5399,37 +5399,32 @@ NAIBU.Time = {
         }
         nc[0] && nc[0].ownerDocument.documentElement.setCurrentTime(s);
         for (var i=0,ncli=nc.length;i<ncli;++i) {
-          var nci = nc[i];
-          if (nci._start || (nci._start === 0)) {
-            if (nci.getStartTime() <= s) {
-              if (nci.getCurrentTime() === 0) {
-                nci.beginElement();
-              }
-              nci._currentFrame++;
-            }
-            if (nci._isRepeat && ((nci.getSimpleDuration() % s) === 0)) {
-              if (nci.getCurrentTime() !== 0) {
-                var ttd = nci.ownerDocument,
-                    evt = ttd.createEvent("TimeEvents");
-                ++nci._numRepeat;
-                evt.initTimeEvent("repeatEvent", ttd.defaultView, nci._numRepeat);
-                nci.dispatchEvent(evt);
-                ttd = evt = void 0;
-              }
-            }
-            if (nci._finish && (nci._finish <= s) && (nci.getCurrentTime() !== 0)) {
-              nci.isRepeat = false;
-              nci.endElement();
-              nci._frame && nci._frame();
-              nci._currentFrame = 0;
-              delete nci._start;
-              nci._finish = null;
-            } else if (!!nci._frame) {
-              nci._frame();
-            }
+          var nci = nc[i]
+              s2 = s + 100,
+              s1 = s - 100;
+          if ((nci._start || (nci._start === 0)) && (nci.getCurrentTime() === 0) && (s1 <= nci._start && nci._start < s2)) {
+            nci.beginElement();
+          }
+          if (nci._isRepeat && (nci.getCurrentTime() !== 0) && ((nci.getSimpleDuration() % s) === 0)) {
+            var ttd = nci.ownerDocument,
+                evt = ttd.createEvent("TimeEvents");
+            ++nci._numRepeat;
+            evt.initTimeEvent("repeatEvent", ttd.defaultView, nci._numRepeat);
+            nci.dispatchEvent(evt);
+            ttd = evt = void 0;
+          }
+          if ((nci._finish || (nci._finish === 0)) && (s1 <= nci._finish && nci._finish < s2) && (nci.getCurrentTime() !== 0)) {
+            nci.endElement();
+            nci._frame && nci._frame();
+            nci._currentFrame = 0;
+          }
+          if (nci._frame) {
+            nci._currentFrame++;
+            nci._frame();
           }
-          nci = void 0;
         }
+        ++NAIBU.Time.currentFrame;
+        nci = s1 = s2 = void 0;
 /*      } catch (e) {
         stlog.add(e, 4157);
       }*/