OSDN Git Service

Modify the _tocallForPath method
authordhrname <dhrname@users.sourceforge.jp>
Sun, 5 Mar 2017 12:22:15 +0000 (21:22 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Sun, 5 Mar 2017 12:22:15 +0000 (21:22 +0900)
org/w3c/dom/smil.js

index 117a56f..a5c639a 100644 (file)
@@ -2055,9 +2055,13 @@ base("$calcMode").up("$attribute").mix( {
     /*this.$animateElement.tocallメソッドを置き換えるためのメソッド\r
      * mpath要素が指定されたときか、path属性のときにのみ使われる*/\r
     _tocallForPath: function(advance) {\r
+      if (this.isKeyPoints) {\r
+        /*keyPoints属性の値に従って、advance値を決定する。\r
+         * なお、$animateElementはinitメソッドで書き換えているので、二重に呼び出す必要がある*/\r
+        advance = +this.$animateElement.$animateElement.tocall.call(this, advance);\r
+      }\r
       var path = this.path,\r
-          advanceLength = advance * path.getTotalLength()\r
-                            * this.$animateElement.$animateElement.tocall.call(this, advance);\r
+          advanceLength = advance * path.getTotalLength();\r
       /*全体の距離から、現在進めている距離を算出して、そこから、現在点を導き出す*/\r
       var point = path.getPointAtLength(advanceLength),\r
           rotate = 0; //追加すべき角度\r
@@ -2097,7 +2101,9 @@ base("$calcMode").up("$attribute").mix( {
     this.isSum = true;\r
     this.mode = this.getAttr("mode", "paced");\r
     this.rotate = this.getAttr("rotate", "0");\r
-    if (ele.hasAttributeNS(null, "keyPoints") && !ele.hasAttributeNS(null, "path")) {\r
+    /*isKeyPointsプロパティはkeyPoints属性が設定されていたら真*/\r
+    this.isKeyPoints = ele.hasAttributeNS(null, "keyPoints");\r
+    if (this.isKeyPoints && !ele.hasAttributeNS(null, "path")) {\r
       /*keyPoints属性がある場合は、path属性に指定がなければ、\r
        * values属性などの値をpath属性に書いておく*/\r
        var values = this.getAttr( "values", this.getAttr("from", "")+" L "+this.getAttr("to", "") );\r