[Sie-announce] SIEコード [1100] NAIBU.PaintColor. prototype. gradientの整理

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 3月 21日 (土) 23:11:09 JST


Revision: 1100
          http://svn.sourceforge.jp/view?root=sie&view=rev&rev=1100
Author:   dhrname
Date:     2009-03-21 23:11:09 +0900 (Sat, 21 Mar 2009)

Log Message:
-----------
NAIBU.PaintColor.prototype.gradientの整理

Modified Paths:
--------------
    branches/04x/046/sie.js

Modified: branches/04x/046/sie.js
===================================================================
--- branches/04x/046/sie.js	2009-03-20 12:51:50 UTC (rev 1099)
+++ branches/04x/046/sie.js	2009-03-21 14:11:09 UTC (rev 1100)
@@ -999,7 +999,7 @@
     try {
     if (this._urlreg.test(this.fill)) { //fill属性の値がurl(#id)ならば、idを設定したグラデーション関連要素を呼び出す
       this.w = w; this.h = h; //radialGradientで必要
-      isRadial = this.gradient(fillElement, RegExp.$1, el.getAttribute("path"), el.currentStyle.width, el.currentStyle.height);
+      isRadial = this.gradient(fillElement, RegExp.$1);
     } else {
       fillElement.setAttribute("color", this.color(this.fill));
       var fillOpacity = this.fillopacity * this.opacity; //opacityを掛け合わせる
@@ -1210,7 +1210,7 @@
   return color;
 }
 //linearGradient、radialGradient要素を処理
-NAIBU.PaintColor.prototype.gradient = function pcgradient( /*element*/ ele, /*string*/ id, /*string*/ data) {
+NAIBU.PaintColor.prototype.gradient = function pcgradient( /*element*/ ele, /*string*/ id) {
   var grad = document.getElementById(id);
   if (grad) {
   var grad2 = grad;
@@ -1263,12 +1263,13 @@
     var cy = parseFloat((grad.getAttribute("cy") || "0.5").replace(/%/, ""));
     var r = rx = ry = parseFloat((grad.getAttribute("r") || "0.5").replace(/%/, ""));
     var el = this.w, et = this.h, er = 0, eb = 0;
+    var data = this.tar.getAttribute("path")+"";
     var units = grad.getAttribute("gradientUnits");
     if (!units || units === "objectBoundingBox") {
       //%の場合は小数点に変換(10% -> 0.1)
       cx = cx > 1 ? cx/100 : cx; cy = cy > 1 ? cy/100 : cy; r = r > 1 ? r/100 : r;
       //要素の境界領域を求める(四隅の座標を求める)
-      var degis = (this.tar.getAttribute("path")+"").match(/[0-9\-]+/g);
+      var degis = data.match(/[0-9\-]+/g);
       for (var i=0,degisli=degis.length;i<degisli;i+=2) {
         var nx = parseInt(degis[i]), ny = parseInt(degis[i+1]);
         el = el > nx ? nx : el;




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