OSDN Git Service

Modify the additive attribute
authordhrname <dhrname@users.sourceforge.jp>
Mon, 30 Nov 2015 12:55:35 +0000 (21:55 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Mon, 30 Nov 2015 12:55:35 +0000 (21:55 +0900)
org/w3c/dom/smil.js

index 921b09d..ac9d7a9 100644 (file)
@@ -592,7 +592,6 @@ base("$from").of( {
           deg = this.degit,\r
           additive = this.additive,\r
           accumulate = this.accumulate;\r
-      \r
       for (var i=0,nuli=numList.length;i<nuli;++i) {\r
         /*原点Oを(0,0,...0)とおく\r
          *$fromと$toを、原点Oからの二つのベクトル (n次空間のベクトル)、ベクトルOFとベクトルOTと考える\r
@@ -1137,18 +1136,6 @@ base("$calcMode").up("$attribute").mix( {
           rank: Number.MAX_VALUE //最低ランクにすることで、一番最後にタイムラインを実行させる\r
         }\r
       );\r
-      /*additive属性がsum (加法アニメーション)の場合*/\r
-      if (ele && ele.getAttributeNS(null, "additive") === "sum") {\r
-        ele.addEventListener("beginEvent", function(evt) {\r
-          line.setAdditive(evt.target.paretnNode.getAttributeNS(null, this.attrName));\r
-        }.bind(this), false);\r
-      }\r
-      /*acuumulate属性がsum (蓄積アニメーション)の場合*/\r
-      if (ele && ele.getAttributeNS(null, "accumulate") === "sum") {\r
-        ele.addEventListener("repeatEvent", function(evt) {\r
-          line.setAccumulate(evt.detail);\r
-        }, false);\r
-      }\r
     }\r
     /*アニメーションが再起動する可能性もあるため、isEndプロパティはここで初期化*/\r
     this.isEnd = false;\r
@@ -1289,6 +1276,24 @@ base("$calcMode").up("$attribute").mix( {
        return (this.mode !== "spline")\r
                || (s(0.1) !== Math.PI);\r
     }, this );\r
+    \r
+    /*additive属性がsum (加法アニメーション)の場合*/\r
+    if (ele.getAttributeNS(null, "additive") === "sum") {\r
+      ele.addEventListener("beginEvent", function(evt) {\r
+        to.forEach( function(x) {\r
+          x.to.setAdditive(evt.target.parentNode.getAttributeNS(null, this.attrName));\r
+        } )\r
+      }.bind(this), false);\r
+    }\r
+    /*acuumulate属性がsum (蓄積アニメーション)の場合*/\r
+    if (ele.getAttributeNS(null, "accumulate") === "sum") {\r
+      ele.addEventListener("repeatEvent", function(evt) {\r
+        to.forEach( function(x) {\r
+          x.to.call();\r
+          x.to.setAccumulate(evt.detail);\r
+        } )\r
+      }, false);\r
+    }\r
   }\r
 });\r
 \r