[Sie-announce] SIEコード [2157] 0. 63統合

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 11月 18日 (木) 20:10:36 JST


Revision: 2157
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2157
Author:   dhrname
Date:     2010-11-18 20:10:36 +0900 (Thu, 18 Nov 2010)

Log Message:
-----------
0.63統合

Modified Paths:
--------------
    trunk/sie.js

Property Changed:
----------------
    trunk/sie.js

Modified: trunk/sie.js
===================================================================
--- trunk/sie.js	2010-11-18 11:06:38 UTC (rev 2156)
+++ trunk/sie.js	2010-11-18 11:10:36 UTC (rev 2157)
@@ -326,25 +326,11 @@
  *ノードのコピーを作る。引数は、子ノードのコピーも作るかどうか。コピー機能。
  */
 /*Node*/ cloneNode : function( /*boolean*/ deep) {
-  var s;
-  switch (this.nodeType) {
-  case Node.ELEMENT_NODE:
-    s = new Element();
-    s.tagName = this.tagName;
-    s.attributes._copyNode(this.attributes,false); //NamedNodeMapのコピーを行う
-  break;
-  case Node.DOCUMENT_NODE:
-    s = new Document();
-  break;
-  default:
+  if ("ownerDocument" in this) {
+    var s = this.ownerDocument.importNode(this, deep);
+  } else {
     s = new Node();
-  break;
   }
-  s.parentNode = null;
-  s.nodeType = this.nodeType; s.nodeValue = this.nodeValue; s.nodeName = this.nodeName; s.namespaceURI = this.namespaceURI; s.localName = this.localName; s.prefix = this.prefix;
-  if (deep) {
-    s.childNodes._copyNode(this.childNodes,true);
-  }
   return s;
 },
 /*normalizeメソッド
@@ -2672,8 +2658,8 @@
 /*interface SVGLocatable*/
 /*SVGRect*/   SVGElement.prototype.getBBox = function(){
   var s = new SVGRect();
-  var data = this._tar.path.value, vi = this.ownerDocument.documentElement;
-  var el = vi.width.baseVal.value, et = vi.height.baseVal.value, er = 0, eb = 0;
+  var data = this._tar.path.value, vi = this.ownerDocument.documentElement.viewport;
+  var el = vi.width, et = vi.height, er = 0, eb = 0;
   /*要素の境界領域を求める(四隅の座標を求める)
    *etは境界領域の上からビューポート(例えばsvg要素)の上端までの距離であり、ebは境界領域の下からビューポートの下端までの距離
    *elは境界領域の左からビューポートの左端までの距離であり、erは境界領域の右からビューポートの右端までの距離
@@ -2688,8 +2674,8 @@
     nx = ny = null;
   }
   data = degis = null;
-  s.x      = et;
-  s.y      = el;
+  s.x      = el;
+  s.y      = et;
   s.width  = er - el;
   s.height = eb - et;
   el = et = er = eb = vi = null;
@@ -3342,6 +3328,8 @@
                 ev.initEvent("SVGLoad", false, false);
                 tar.dispatchEvent(ev);
                 ev = null;
+                /*IEのメモリリーク対策として、空関数を入力*/
+                xmlhttp.onreadystatechange = NAIBU.emptyFunction;
               }
             }
           }
@@ -3928,9 +3916,10 @@
       }
       str = attr = null;
       var sdt = tar._tar, sp = document.createElement("div"), dcp = document.createElement("v:group");
-      dcp.style.width = tar.width.baseVal.value+ "px";
-      dcp.style.height = tar.height.baseVal.value+ "px";
-      dcp.coordsize = tar.width.baseVal.value+ " " +tar.height.baseVal.value;
+      var view = tar.viewport;
+      dcp.style.width = view.width+ "px";
+      dcp.style.height = view.height+ "px";
+      dcp.coordsize = view.width+ " " +view.height;
       sp.appendChild(dcp);
       objei.parentNode.insertBefore(sp, objei);
       dcp.appendChild(sdt)
@@ -4003,6 +3992,8 @@
       }
       s.defaultView._cache = s.defaultView._cache_ele = null;
       s = evt = null;
+      /*IEのメモリリーク対策として、空関数を入力*/
+      this.xmlhttp.onreadystatechange = NAIBU.emptyFunction;
       if (this._next) {
         this._next._init();
       } else {
@@ -4016,6 +4007,8 @@
     return (this._document);
   }
 };
+/*空関数(IEのメモリリーク対策)*/
+NAIBU.emptyFunction = function() {};
 
 /*SVGStyleElement
  *style要素をあらわすオブジェクト
@@ -4042,8 +4035,8 @@
 };
 SVGPoint.prototype.matrixTransform = function(/*SVGMatrix*/ matrix ) {
   /*整数にしているのは、VMLの設計上、小数点を扱えないときがあるため*/
-  var x = parseInt(matrix.a * this.x + matrix.c * this.y + matrix.e, 10);
-  var y = parseInt(matrix.b * this.x + matrix.d * this.y + matrix.f, 10);
+  var x = parseInt(matrix.a * this.x + matrix.c * this.y + matrix.e);
+  var y = parseInt(matrix.b * this.x + matrix.d * this.y + matrix.f);
   if ((-1 < x) && (x < 1)) {x=1;}
   if ((-1 < y) && (y < 1)) {y=1;}
   var s = new SVGPoint();
@@ -4649,6 +4642,10 @@
        *SVG1.1 「8.3.9 The grammar for path data」の項目にある最後の文章を参照
        */
       var tnl = tar.normalizedPathSegList, tlist = tar.pathSegList, D = [], _parseFloat = parseFloat;
+      if (tnl.numberOfItems > 0) {
+        tnl.clear();
+        tlist.clear();
+      }
       /*d属性の値を正規表現を用いて、二次元配列Dに変換している。もし、d属性の値が"M 20 30 L20 40"ならば、
        *JSONにおける表現は以下のとおり
        *D = [["M", 20, 30], ["L", 20 40]]
@@ -4735,7 +4732,7 @@
        *変換をする処理。相対座標を絶対座標に変換して、M、L、Cコマンドに正規化していく
        */
       var cx = 0, cy = 0; //現在セグメントの終了点の絶対座標を示す (相対座標を絶対座標に変換するときに使用)
-      var xn = 0, yn = 0; //T,tコマンドで仮想的な座標を算出するのに用いる
+      var xn = 0, yn = 0; //T,tコマンドで仮想的な座標を算出するのに用いる。第一コントロール点
       var startx = 0, starty = 0; //M,mコマンドにおける始点座標(Z,zコマンドで用いる)
       for (var j=0, tli=tlist.numberOfItems;j<tli;++j) {
         var ti = tlist.getItem(j), ts = ti.pathSegType, dii = ti.pathSegTypeAsLetter;
@@ -4865,11 +4862,14 @@
               if (tg.pathSegTypeAsLetter === "C") {
                 var x1 = 2*tg.x - tg.x2;
                 var y1 = 2*tg.y - tg.y2;
-              } else {
-                var x1 = ti.x2, y1 = ti.y2;
+              } else { //前のコマンドがCでなければ、現在の座標を第1コントロール点に用いる
+                var x1 = rx, y1 = ry;
               }
-              tnl.appendItem(tar.createSVGPathSegCurvetoCubicAbs(cx, cy, x1, y1, ti.x2, ti.y2));
+            } else {
+              var x1 = rx, y1 = ry;
             }
+            tnl.appendItem(tar.createSVGPathSegCurvetoCubicAbs(cx, cy, x1, y1, ti.x2, ti.y2));
+            x1 = y1 = null;
           } else if (dii === "s") {
             if (j !== 0) {
               var tg = tnl.getItem(tnl.numberOfItems-1);
@@ -4877,23 +4877,33 @@
                 var x1 = 2*tg.x - tg.x2;
                 var y1 = 2*tg.y - tg.y2;
               } else {
-                var x1 = ti.x2, y1 = ti.y2;
+                var x1 = rx, y1 = ry;
               }
-              tnl.appendItem(tar.createSVGPathSegCurvetoCubicAbs(cx, cy, x1, y1, ti.x2+rx, ti.y2+ry));
+            } else {
+              var x1 = rx, y1 = ry;
             }
+            tnl.appendItem(tar.createSVGPathSegCurvetoCubicAbs(cx, cy, x1, y1, ti.x2+rx, ti.y2+ry));
+            x1 = y1 = null;
           } else if (dii === "T" || dii === "t") {
             if (j !== 0) {
               var tg = tlist.getItem(j-1);
               if ("QqTt".indexOf(tg.pathSegTypeAsLetter) > -1) {
-                tnl.appendItem(tar.createSVGPathSegCurvetoCubicAbs(cx, cy, (rx + 2*xn) / 3, (ry + 2*yn) / 3, (2*xn + cx) / 3, (2*yn + cy) / 3));
-                xn = 2*cx - xn;
-                yn = 2*cy - yn;
+               } else {
+                xn = rx, yn = ry;
               }
+            } else {
+              xn = rx, yn = ry;
             }
+            tnl.appendItem(tar.createSVGPathSegCurvetoCubicAbs(cx, cy, (rx + 2*xn) / 3, (ry + 2*yn) / 3, (2*xn + cx) / 3, (2*yn + cy) / 3));
+            xn = 2*cx - xn;
+            yn = 2*cy - yn;
+            xx1 = yy1 = null;
           } else if (dii === "H" || dii === "h") {
             tnl.appendItem(tar.createSVGPathSegLinetoAbs(cx, ry));
+            cy = ry; //勝手にti.yが0としているため
           } else if (dii === "V" || dii === "v") {
             tnl.appendItem(tar.createSVGPathSegLinetoAbs(rx, cy));
+            cx = rx;
           }
         }
         ti = dii = ts = null;
@@ -5213,7 +5223,7 @@
   };
   /*SVGPathSegLinetoVerticalAbs*/    SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs = function(/*float*/ y ) {
     var s = new SVGPathSegLinetoVerticalAbs();
-    s.x = 0; //DOMでは指定されていないが、変換処理が楽なので用いる
+    s.x = 0;
     s.y = y;
     return s;
   };
@@ -5752,6 +5762,7 @@
       /*Textノードにdiv要素を格納したリストをプロパティとして蓄えておく*/
       tar._tars = [];
       var data = tar.data.replace(/^\s+/, "").replace(/\s+$/, "");
+      tar.data = data;
       for (var i=0, tdli=data.length;i<tdli;++i) {
         var d = document.createElement("div"), dstyle = d.style;
         dstyle.position = "absolute";
@@ -6429,7 +6440,7 @@
 SVGLinearGradientElement.prototype = new SVGGradientElement();
 
 function SVGRadialGradientElement() { 
-  SVGGradientElement.apply(this, arguments);
+  SVGGradientElement.apply(this);
   /*readonly SVGAnimatedLength*/ this.cx = new SVGAnimatedLength();
   /*readonly SVGAnimatedLength*/ this.cy = new SVGAnimatedLength();
   /*readonly SVGAnimatedLength*/ this.r = new SVGAnimatedLength();
@@ -6452,8 +6463,8 @@
       var r = grad.r.baseVal.value, rx, ry;
       rx = ry = r;
       var tarrect = tar.getBBox();
-      var vi = tar.ownerDocument.documentElement;
-      var el = vi.width.baseVal.value, et = vi.height.baseVal.value, er = 0, eb = 0;
+      var vi = tar.ownerDocument.documentElement.viewport;
+      var el = vi.width, et = vi.height, er = 0, eb = 0;
       var units = grad.getAttributeNS(null, "gradientUnits");
       if (!units || units === "objectBoundingBox") {
         //%の場合は小数点に変換(10% -> 0.1)
@@ -6467,7 +6478,7 @@
       if (gt) {
         grad.setAttributeNS(null, "transform", gt);
       }
-      matrix = tar.getScreenCTM().multiply(grad.getCTM());
+      var matrix = tar.getScreenCTM().multiply(grad.getCTM());
       el = cx - rx; et = cy - ry; er = cx + rx; eb = cy + ry;
       var rrx = rx * 0.55228, rry = ry * 0.55228;
       var list = ["m", cx,et, "c", cx-rrx,et, el,cy-rry, el,cy, el,cy+rry, cx-rrx,eb, cx,eb, cx+rrx,eb, er,cy+rry, er,cy, er,cy-rry, cx+rrx,et, cx,et, "x e"];
@@ -6491,7 +6502,7 @@
       var background = document.createElement("div"), bstyle = background.style;
       bstyle.position = "absolute";
       bstyle.display = "inline-block";
-      var w = vi.width.baseVal.value, h = vi.height.baseVal.value;
+      var w = vi.width, h = vi.height;
       bstyle.textAlign = "left"; bstyle.top = "0px"; bstyle.left = "0px"; bstyle.width = w+ "px"; bstyle.height = h+ "px";
       outline.appendChild(background);
       bstyle.filter = "progid:DXImageTransform.Microsoft.Compositor";
@@ -6504,7 +6515,7 @@
       background.filters[0].play();
       tar._tar.parentNode.insertBefore(background, tar._tar);
       tar._tar.filled = "false";
-      ellipse = circle = data = list = gt = cx = cy = r = w = h = null;
+      ellipse = outline = background = bstyle = circle = data = list = gt = cx = cy = r = w = h = matrix = null;
     } else if (!ele.parentNode){
       tar._tar.appendChild(ele);
     }
@@ -6645,14 +6656,23 @@
   this._tar = document.createElement("a");
   /*readonly SVGAnimatedString*/ this.target = new SVGAnimatedString();
   this.addEventListener("DOMAttrModified", function(evt){
+    var tar = evt.target;
+    if (evt.eventPhase === Event.BUBBLING_PHASE) {
+      return; //強制終了させる
+    }
     if (evt.attrName === "target") {
-      evt.target.target.baseVal = evt.newValue;
+      tar.target.baseVal = evt.newValue;
+    } else if (evt.attrName === "xlink:title") {
+      tar._tar.setAttribute("title", evt.newValue);
     }
     evt = null;
   }, false);
   this.addEventListener("DOMNodeInserted", function(evt){
     var tar = evt.target;
     if (evt.eventPhase === Event.BUBBLING_PHASE) {
+      if ((tar.parentNode === evt.currentTarget) && (tar.nodeType === Node.TEXT_NODE)) { //直接Textノードが指定されれば
+        evt.currentTarget._tar.appendChild(document.createTextNode(tar.data));
+      }
       return; //強制終了させる
     }
     if (tar.nextSibling) {
@@ -6727,6 +6747,8 @@
   this.addEventListener("DOMAttrModified", function(evt){
     if (evt.attrName === "type") {
       evt.target.type = evt.newValue;
+    } else if (!!tar.parentNode._tar){
+      tar.parentNode._tar.appendChild(tar._tar);
     }
     evt = null;
   }, false);
@@ -6819,7 +6841,7 @@
   this._begin = null;
   this._end = null;
   this._from = this._to = this._values = this._by = null;
-  this._keyTimes = null;
+  this._keyTimes = [0, 1];
   this.addEventListener("beginEvent", function(evt) {
     var tar = evt.target;
     if (!tar.isRepeat) {
@@ -6860,7 +6882,11 @@
     } else if (name === "by") {
       tar._by = evt.newValue;
     } else if (name === "keyTimes") {
-      tar._keyTimes = evt.newValue.split(";");
+      var s = evt.newValue.split(";");
+      for (var i=0;i<s.length;++i) {
+        tar._keyTimes[i] = parseFloat(s[i]);
+      }
+      s = null;
     }
     evt = null;
   }, false);
@@ -6884,7 +6910,7 @@
         tar._values = [null, tar._to];
       } else if (tar._by) {
         tar._values = ["0", tar._by];
-      } else {
+      } else if (!tar.hasChildNodes() && !tar.hasAttributeNS(null, "path")) { //SVGAnimateMotionElementに留意
         /*アニメーションの効果が出ないように調整する
          *SMILアニメーションの仕様を参照
          *
@@ -7010,8 +7036,12 @@
     throw new DOMException(DOMException.INVALID_STATE_ERR);
   }
 };
+/*getCurrentTimeメソッド
+ *現在の時間コンテナ内での時刻であり、
+ *決して現在時刻ではない。要素のbeginイベントの発火したときが0sである。
+ */
 /*float*/ SVGAnimationElement.prototype.getCurrentTime = function(){
-  return (this._currentFrame * 125 / 0.8);
+  return (this._currentFrame * 125 * 0.8);
 };
 /*float*/ SVGAnimationElement.prototype.getSimpleDuration = function(){
   if (!!!this._simpleDuration && !!!this._end && this._simpleDuration !== 0) {
@@ -7033,7 +7063,7 @@
 /*      try{*/
         var ntc = NAIBU.Time.currentFrame++;
         var nc = NAIBU.Clip;
-        var s = ntc * 125 / 0.8; //フレーム数ntcをミリ秒数sに変換
+        var s = ntc * 125 * 0.8; //フレーム数ntcをミリ秒数sに変換
         if (ntc > NAIBU.Time.Max) {
           clearInterval(NAIBU.stop);
         }
@@ -7065,7 +7095,7 @@
         stlog.add(e, 4157);
       }*/
         }),
-         125
+         1
       );
     }
  }
@@ -7078,11 +7108,132 @@
    *くわしくはNAIBU.Time.start関数のコードを参照
    */
   NAIBU.Clip[NAIBU.Clip.length] = this;
+  /*_valueListプロパティは、
+   *機械が理解できる形で保管されているvalueの値の配列リスト
+   */
+  this._valueList = [];
+  this.addEventListener("DOMNodeInserted", function(evt){
+    if (evt.eventPhase === Event.BUBBLING_PHASE) {
+      return; //強制終了させる
+    }
+    var tar = evt.target;
+    tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt){
+      var tar = evt.target, attrName = tar.getAttributeNS(null, "attributeName"),ttr = tar.targetElement, tta = ttr[attrName];
+      /*tar.valuesのリスト: ex. ["12px", "13px"]を、次のように機械に理解できるよう変換して、tar._valueListに格納
+       *[(new SVGPoint()), (new SVGPoint())]
+       *この_valueListプロパティはアニメの際に使うので、_valuesプロパティはアニメ中に使わない
+       */
+      var vi = ttr.cloneNode(false);
+      if (!tar._values[0]) {
+        tar._values[0] = ttr.getAttributeNS(null, attrName) || ttr.style.getPropertyValue(attrName);
+      }
+      if (!!tta) {
+        tta.animVal = vi[attrName].baseVal;
+        for (var i=0, tav=tar._values, tvli=tav.length;i<tvli;++i) {
+          var vir = ttr.cloneNode(false); //仮の要素
+          delete vir._tar;
+          vir.setAttributeNS(null, attrName, tav[i]);
+          tar._valueList[tar._valueList.length] = vir[attrName].baseVal;
+        }
+      } else if (!!CSS2Properties[attrName] || attrName.indexOf("-") > -1) { //スタイルシートのプロパティならば
+        for (var i=0, tav=tar._values, tvli=tav.length;i<tvli;++i) {
+          tar._valueList[i] = parseFloat(tav[i]);
+        }
+      } else if ("animatedPoints" in ttr) {
+        ttr.animatedPoints = vi.points;
+        for (var i=0, tav=tar._values, tvli=tav.length;i<tvli;++i) {
+          var vir = ttr.cloneNode(false);
+          delete vir._tar;
+          vir.setAttributeNS(null, "points", tav[i]);
+          tar._valueList[tar._valueList.length] = vir.points;
+        }
+      } else if ("normalizedPathSegList" in ttr) {
+        ttr.animatedNormalizedPathSegList = vi.normalizedPathSegList;
+        for (var i=0, tav=tar._values, tvli=tav.length;i<tvli;++i) {
+          var vir = ttr.cloneNode(false);
+          delete vir._tar;
+          vir.setAttributeNS(null, "d", tav[i]);
+          tar._valueList[tar._valueList.length] = vir.normalizedPathSegList;
+        }
+      } else {
+        vi = null;
+        return;
+      }
+      if ((tar._keyTimes[1] === 1) && (tar._valueList.length > 2)) {
+        for (var i=0,n=0,tvli=tar._valueList.length-1;i<tvli;++i) {
+          n += 1 / tvli;
+          tar._keyTimes[i+1] = n;
+        }
+      }
+      evt = tta = vir = vi = null;
+    }, false);
+  }, false);
   this.addEventListener("beginEvent", function(evt) {
     var tar = evt.target;
+    var attrName = tar.getAttributeNS(null, "attributeName"), newAttr = tar.targetElement.attributes.getNamedItemNS(null, attrName);
+    var ttr = tar.targetElement, tta = ttr[attrName];
+    tar._frame = function() {
+      var d = tar.getSimpleDuration() * 0.8, n = tar._valueList.length - 1, tg = tar.getCurrentTime();
+      if ((n !== -1) && (d !== 0) && (tg <= d)) {
+        var ii = Math.floor((tg*n) / d);
+      } else {
+        return;
+      }
+      /*setAttrbute(NS)メソッドはDOM属性を書き換えるため利用しない。
+      *
+      * 参照:アニメーションサンドイッチモデル
+      * >アニメーションが起動している時,それは実際,DOMの中の属性値は変化しない。
+      *http://www.jsa.or.jp/stdz/instac/syoukai/H13/H13annual_report/12/ngc-wg3/offline/smil_20_20020131/animation.html#animationNS-AnimationSandwichModel
+      */
+      var evt = tar.ownerDocument.createEvent("MutationEvents");
+      evt.initMutationEvent("DOMNodeInsertedIntoDocument", false, false, null, null, null, null, null);
+      if (!!tta) {
+        var base = tta.baseVal, tanim = tta.animVal;
+        var v1 = tar._valueList[ii].value, v2 = tar._valueList[ii+1].value, di = (tar._keyTimes[ii+1] - tar._keyTimes[ii]) * d;
+        /*vを求める公式に関しては、SMIL2.0 Animation Moduleの単純アニメーション関数の項を参照
+         * 3.4.2 Specifying the simple animation function f(t)
+         *http://www.w3.org/TR/2005/REC-SMIL2-20050107/animation.html#animationNS-SpecifyingAnimationFunction
+         */
+        var v = v1 + (v2-v1) * (tg-tar._keyTimes[ii]*d) / di;
+        tanim.newValueSpecifiedUnits(tanim.unitType, v);
+        tta.baseVal = tanim;
+        tanim = null;
+        ttr.dispatchEvent(evt);
+        /*変化値はanimValプロパティに収納しておき、
+         *変化する前の、元の値はbaseValプロパティに再び収納しておく
+         */
+        tta.animVal = tta.baseVal;
+        tta.baseVal = base;
+      } else if (!!CSS2Properties[attrName] || attrName.indexOf("-") > -1) { //スタイルシートのプロパティならば
+        var base = null;
+        var v1 = tar._valueList[ii], v2 = tar._valueList[ii+1];
+        var v = v1 + (v2-v1) * (tg-tar._keyTimes[ii]*d) / d;
+        ttr.dispatchEvent(evt);
+      } else if ("animatedPoints" in ttr) {
+        var base = ttr.points;
+        ttr.points = ttr.animatedPoints;
+        ttr.dispatchEvent(evt);
+        tta.animatedPoints = tta.points;
+        tta.points = base;
+      } else if ("normalizedPathSegList" in ttr) {
+        var base = ttr.normalizedPathSegList;
+        ttr.normalizedPathSegList = ttr.animatedNormalizedPathSegList;
+        ttr.dispatchEvent(evt);
+        tta.animatedNormalizedPathSegList = tta.normalizedPathSegList;
+        tta.normalizedPathSegList = base;
+      }
+     evt = v1 = v2 = v = null;
+    };
+    evt = vir = null;
   }, false);
   this.addEventListener("endEvent", function(evt) {
-    var tar = evt.target;
+    var tar = evt.target, fill = tar.getAttributeNS(null, "fill");
+    if (!fill || (fill === "remove")) {
+      var evt = tar.ownerDocument.createEvent("MutationEvents");
+      evt.initMutationEvent("DOMNodeInsertedIntoDocument", false, false, null, null, null, null, null);
+      tar.targetElement.dispatchEvent(evt);
+      evt = null;
+    }
   }, false);
   this.addEventListener("repeatEvent", function(evt) {
     var tar = evt.target;
@@ -7135,6 +7286,12 @@
         style.setProperty(attrName, tar.getAttributeNS(null, "to"), null);
         style = null;
       }
+      var tc = to.rgbColor, fc = from.rgbColor, num = CSSPrimitiveValue.CSS_NUMBER, di = (t - ti) / ki;
+      var r = fc.red.getFloatValue(num) + (tc.red.getFloatValue(num) - fc.red.getFloatValue(num)) * di;
+      var g = fc.green.getFloatValue(num) + (tc.green.getFloatValue(num) - fc.green.getFloatValue(num)) * di;
+      var b = fc.blue.getFloatValue(num) + (tc.blue.getFloatValue(num) - fc.blue.getFloatValue(num)) * di;
+      style.setProperty(attrName, "rgb(" +Math.ceil(r)+ "," +Math.ceil(g)+ "," +Math.ceil(b)+ ")", null);
+      _tar = t = to = from = fc = tc = num = r = g = b = null;
     }
     evt = tar = attrName = null;
   }, false);
@@ -7186,17 +7343,22 @@
     tar._frame = function() {
       var _tar = tar, tpn = _tar._path;
       if (!!tpn) {
-        var st = (tpn.getTotalLength() / _tar.getSimpleDuration()) * _tar.getCurrentTime() / 125 * 0.8;
+        var tgsd = _tar.getSimpleDuration();
+        if (tgsd === 0) {
+          tgsd = null;
+          return;
+        }
+        var st = (tpn.getTotalLength() / tgsd) * _tar.getCurrentTime() / 125 * 0.8;
         var p = tpn.getPointAtLength(st), trans = _tar.targetElement.transform;
         p = p.matrixTransform(_tar.targetElement.getScreenCTM())
-        trans.animVal.getItem(trans.numberOfItmes-1).setTranslate(p.x, p.y);
+        trans.animVal.getItem(trans.animVal.numberOfItems-1).setTranslate(p.x, p.y);
         var base = trans.baseVal;
         trans.baseVal = trans.animVal;
         var evtt = _tar.ownerDocument.createEvent("MutationEvents");
         evtt.initMutationEvent("DOMNodeInsertedIntoDocument", false, false, null, null, null, null, null);
         _tar.targetElement.dispatchEvent(evtt);
         trans.baseVal = base;
-        evtt = base = trans = null;
+        evtt = base = trans = st = tgsd = p = null;
       }
     }
     evt = trans = null;
@@ -7240,7 +7402,12 @@
     }
     tar._frame = function() {
       var _tar = tar, to = new SVGColor(), from = new SVGColor();
-      var n = _tar._values.length - 1, t = _tar.getCurrentTime(), d = _tar.getSimpleDuration(), i = Math.floor((t*n) / d);
+      var d = _tar.getSimpleDuration();
+      if (d === 0) {
+        d = null;
+        return;
+      }
+      var n = _tar._values.length - 1, t = _tar.getCurrentTime(), i = Math.floor((t*n) / d);
       to.setRGBColor(_tar._values[i+1]);
       from.setRGBColor(_tar._values[i]);
       if (!!!_tar._keyTimes) {


Property changes on: trunk/sie.js
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/04x/040/sie.js:812-829
/branches/04x/041/sie.js:891-923
/branches/04x/042/sie.js:927-967
/branches/04x/043/sie.js:969-1013
/branches/04x/044/sie.js:1015-1067
/branches/04x/045/sie.js:1069-1078
/branches/04x/046/sie.js:1080-1129
/branches/04x/047/sie.js:1131-1164
/branches/04x/048/sie.js:1166-1180
/branches/04x/sie.js:830-1181
/branches/05x/050/sie.js:1183-1201
/branches/05x/051/sie.js:1207-1323
/branches/05x/052/sie.js:1325-1352
/branches/05x/053/sie.js:1354-1400
/branches/05x/054/sie.js:1403-1422
/branches/05x/055/sie.js:1424-1454
/branches/05x/056/sie.js:1456-1491
/branches/05x/057/sie.js:1496-1523
/branches/05x/058/sie.js:1526-1590
/branches/05x/sie.js:1183-1594
/branches/06x/060/sie.js:1603-1850
/branches/06x/sie.js:1599-2077
   + /branches/04x/040/sie.js:812-829
/branches/04x/041/sie.js:891-923
/branches/04x/042/sie.js:927-967
/branches/04x/043/sie.js:969-1013
/branches/04x/044/sie.js:1015-1067
/branches/04x/045/sie.js:1069-1078
/branches/04x/046/sie.js:1080-1129
/branches/04x/047/sie.js:1131-1164
/branches/04x/048/sie.js:1166-1180
/branches/04x/sie.js:830-1181
/branches/05x/050/sie.js:1183-1201
/branches/05x/051/sie.js:1207-1323
/branches/05x/052/sie.js:1325-1352
/branches/05x/053/sie.js:1354-1400
/branches/05x/054/sie.js:1403-1422
/branches/05x/055/sie.js:1424-1454
/branches/05x/056/sie.js:1456-1491
/branches/05x/057/sie.js:1496-1523
/branches/05x/058/sie.js:1526-1590
/branches/05x/sie.js:1183-1594
/branches/06x/060/sie.js:1603-1850
/branches/06x/sie.js:1599-2156




Sie-announce メーリングリストの案内
Back to archive index