[Sie-announce] SIEコード [2144]

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 11月 15日 (月) 23:22:34 JST


Revision: 2144
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2144
Author:   dhrname
Date:     2010-11-15 23:22:34 +0900 (Mon, 15 Nov 2010)

Log Message:
-----------


Modified Paths:
--------------
    branches/06x/063/org/w3c/dom/svg.js

Modified: branches/06x/063/org/w3c/dom/svg.js
===================================================================
--- branches/06x/063/org/w3c/dom/svg.js	2010-11-15 11:32:25 UTC (rev 2143)
+++ branches/06x/063/org/w3c/dom/svg.js	2010-11-15 14:22:34 UTC (rev 2144)
@@ -309,8 +309,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は境界領域の右からビューポートの右端までの距離
@@ -1568,9 +1568,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)
@@ -1687,8 +1688,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();
@@ -4092,7 +4093,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();
@@ -4115,8 +4116,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)
@@ -4154,7 +4155,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";
@@ -4846,7 +4847,7 @@
          *http://www.w3.org/TR/2005/REC-SMIL2-20050107/animation.html#animationNS-SpecifyingAnimationFunction
          */
         var v = v1 + (v2-v1) * (tg-tar._keyTimes[ii]*d) / d;
-        console.log(tar._valueList+" " +tar._keyTimes);
+        console.log(tg);
         tanim.newValueSpecifiedUnits(tanim.unitType, v);
         tta.baseVal = tanim;
         tanim = null;
@@ -4879,11 +4880,13 @@
     evt = vir = null;
   }, false);
   this.addEventListener("endEvent", function(evt) {
-    var tar = evt.target;
-    var evt = tar.ownerDocument.createEvent("MutationEvents");
-    evt.initMutationEvent("DOMNodeInsertedIntoDocument", false, false, null, null, null, null, null);
-    tar.targetElement.dispatchEvent(evt);
-    evt = null;
+    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;




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