OSDN Git Service

Change a degits property of the
authordhrname <dhrname@users.sourceforge.jp>
Sun, 22 May 2016 12:38:40 +0000 (21:38 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Sun, 22 May 2016 12:38:40 +0000 (21:38 +0900)
org/w3c/dom/smil.js
tool/Spec/spec/SvgDomSpec.js

index 8eb24ba..4862b28 100644 (file)
@@ -1464,7 +1464,7 @@ base("$calcMode").up("$attribute").mix( {
   },\r
   \r
   /*小数点以下の桁数を指定するため、setValuesメソッドをオーバライドする*/\r
-  degits: 0,\r
+  degits: 1,\r
   setValues: function() {\r
     var s = this.$attribute.setValues.apply(this, arguments),\r
         degits = this.degits;\r
@@ -1479,11 +1479,11 @@ base("$calcMode").up("$attribute").mix( {
  * onメソッドについては、base.jsを参照のこと*/\r
 } ).on ("init", function(ele) {\r
   var isColor = /^(?:fill|stroke|stop-color|color)$/.test(this.attrName);\r
-  if (!isColor) {\r
-    /*通常は、小数点以下の桁数を1桁としておく\r
-     *RGB形式では補間に、小数を使わないため、既定値の0のままにしておく\r
+  if (isColor) {\r
+    /*通常は、小数点以下の桁数を既定値の1桁とする\r
+     *RGB形式では補間に、小数を使わないため、0桁に設定\r
      * (なお、この作業は、setKeyメソッドの前に済ませておく必要がある)*/\r
-    this.degits = 1;\r
+    this.degits = 0;\r
   }\r
   var to, \r
       keyTime = 0,\r
@@ -1570,6 +1570,10 @@ base("$calcMode").up("$attribute").mix( {
    /*additive属性の値がsumのときにtrue*/\r
    isSum: false,\r
    \r
+   /*transform属性の値に使われる数値は精密であることが求められるため、\r
+    *小数点以下の桁数を決めるdegitsプロパティの値も大きくしておく*/\r
+   degits: 15,\r
+   \r
    /*$animateElementオブジェクトのtocallメソッドをオーバライド*/\r
    tocall: function (advance) {\r
      if (this.numberOfList < 0) {\r
index 96ac30a..ebec4de 100644 (file)
@@ -2809,6 +2809,8 @@ describe("SMIL Animation Spec", function() {
         var $animate, ele, frame, p;\r
         beforeEach( function() {\r
           $animate = base("$calcMode").$attribute.$setElement.$animateElement.$animateTransformElement.up();\r
+          /*ここでは、データ量を削るため、degitsプロパティを小数点以下1桁に設定*/\r
+          $animate.degits = 1;\r
           p = document.createElementNS("http://www.w3.org/2000/svg", "g");\r
           ele = document.createElementNS("http://www.w3.org/2000/svg", "animateTransform");\r
           p.appendChild(ele);\r
@@ -3026,6 +3028,8 @@ describe("SMIL Animation Spec", function() {
         var $animate, ele, frame, p;\r
         beforeEach( function() {\r
           $animate = base("$calcMode").$attribute.$setElement.$animateElement.$animateTransformElement.$motionElement.up();\r
+          /*ここでは、データ量を削るため、degitsプロパティを小数点以下1桁に設定*/\r
+          $animate.degits = 1;\r
           p = document.createElementNS("http://www.w3.org/2000/svg", "g");\r
           ele = document.createElementNS("http://www.w3.org/2000/svg", "animateMotion");\r
           p.appendChild(ele);\r