[Sie-announce] SIEコード [2468] SVGLengthのconvertToSpecifiedUnitsメソッドを修正

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2011年 3月 10日 (木) 19:39:03 JST


Revision: 2468
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2468
Author:   dhrname
Date:     2011-03-10 19:39:03 +0900 (Thu, 10 Mar 2011)

Log Message:
-----------
SVGLengthのconvertToSpecifiedUnitsメソッドを修正

Modified Paths:
--------------
    branches/07x/072/org/w3c/dom/svg.js

Modified: branches/07x/072/org/w3c/dom/svg.js
===================================================================
--- branches/07x/072/org/w3c/dom/svg.js	2011-03-09 14:38:06 UTC (rev 2467)
+++ branches/07x/072/org/w3c/dom/svg.js	2011-03-10 10:39:03 UTC (rev 2468)
@@ -556,7 +556,14 @@
  * alert(x.valueAsString); //20mm
  */
   convertToSpecifiedUnits : function (/*unsigned short*/ unitType) {
+    if (this.value === 0) {
+      this.newValueSpecifiedUnits(unitType, 0);
+      return;
+    }
+    var v = this.value;
     this.newValueSpecifiedUnits(unitType, this.valueInSpecifiedUnits);
+    v = v / this.value * this.valueInSpecifiedUnits;
+    this.newValueSpecifiedUnits(unitType, v); 
   },
   /*_emToUnitメソッド
    *emやexが単位に使われていたときに、@fontSizeの値を手がかりに、新たな値へとvalueを変換させる




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