OSDN Git Service

Modify the _tocallForPath method
authordhrname <dhrname@users.sourceforge.jp>
Fri, 24 Feb 2017 13:29:32 +0000 (22:29 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Fri, 24 Feb 2017 13:29:32 +0000 (22:29 +0900)
org/w3c/dom/smil.js

index bb37330..4af130d 100644 (file)
@@ -2075,7 +2075,9 @@ base("$calcMode").up("$attribute").mix( {
     /*setValuesメソッドのオーバライド*/\r
     setValues: function() {\r
       var keyPoints = this.getAttr("keyPoints", null),\r
-          superSetValues = this.$animateElement.setValues;\r
+          /*$animateElementプロパティは下記のinitメソッドで上書きされているため、\r
+           * $animateElementを別方法で呼び出す必要がある*/\r
+          superSetValues = this.$animateElement.$animateElement.setValues;\r
       if (keyPoints) {\r
         return superSetValues.call(this, keyPoints, null, null, null);\r
       } else {\r
@@ -2100,6 +2102,12 @@ 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
+      /*keyPoints属性がある場合は、path属性に指定がなければ、\r
+       * values属性などの値をpath属性に書いておく*/\r
+       var values = this.getAttr( "values", this.getAttr("from", "")+","+this.getAttr("to", "") );\r
+       ele.setAttributeNS( null, "path", "M " +values.replace(/;/g, " ") );\r
+    }\r
     this.path = this.path.cloneNode(true);\r
     var mpath = ele.getElementsByTagNameNS(this.path.namespaceURI, "mpath");\r
     /*$animateは後で、プロパティを書き換えるために使う。tocallメソッドも参照*/\r