From b22a31d870c614847a1ff92e271bfd9aeb3baa5a Mon Sep 17 00:00:00 2001 From: dhrname Date: Sun, 26 Oct 2014 23:09:40 +0900 Subject: [PATCH] =?utf8?q?path=E8=A6=81=E7=B4=A0=E3=81=AE=E3=82=A4?= =?utf8?q?=E3=83=B3=E3=82=BF=E3=83=BC=E3=83=95=E3=82=A7=E3=83=BC=E3=82=B9?= =?utf8?q?=E3=82=92base=E9=96=A2=E6=95=B0=E3=81=A7=E8=A1=A8=E7=8F=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- org/w3c/dom/svg.js | 147 ++++++++++++++++++++++++++--------------------------- 1 file changed, 73 insertions(+), 74 deletions(-) diff --git a/org/w3c/dom/svg.js b/org/w3c/dom/svg.js index 2037d7a..41a6284 100644 --- a/org/w3c/dom/svg.js +++ b/org/w3c/dom/svg.js @@ -2573,7 +2573,7 @@ function SVGPathSegCurvetoQuadraticSmoothRel() { (function(_doc, _math) { //freeArg関数はunloadで使う解放処理 NAIBU.freeArg = function() { - SVGPathElement = _doc = _math = void 0; + _doc = _math = void 0; }; //仮のfill属性とstroke属性の処理 NAIBU._setPaint = function(tar, matrix) { @@ -2705,25 +2705,26 @@ NAIBU._setPaint = function(tar, matrix) { tod = _doc = el = fill = stroke = sp = fp = style = cursor = tar = matrix = vis = disp = num = void 0; }; -function SVGPathElement(_doc) { - this._tar = _doc.createElement("v:shape"); - //interface SVGAnimatedPathData - var sp = base("$SVGStringList").$SVGPathSegList; - /*readonly SVGPathSegList*/ this.pathSegList = sp.up(); - this.animatedPathSegList = this.pathSegList; - /*readonly SVGPathSegList*/ this.normalizedPathSegList = sp.up(); - sp = _doc = void 0; - this.animatedNormalizedPathSegList = this.normalizedPathSegList; - /*readonly SVGAnimatedNumber*/ this.pathLength = base("$SVGAnimatedNumber").up(); - //以下は、d属性に変更があった場合の処理 - this.addEventListener("DOMAttrModified", this._attrModi, false); - /*以下の処理は、このpath要素ノードがDOMツリーに追加されて初めて、 - *描画が開始されることを示す。つまり、appendChildで挿入されない限り、描画をしない。 - */ - this.addEventListener("DOMNodeInserted", this._nodeInsert, false); -}; -(function(_sproto) { -_sproto._attrModi = function(evt){ +base.$1.up("http://www.w3.org/2000/svgpath") + .on("initialize", function (_doc) { + this._tar = _doc.createElement("v:shape"); + //interface SVGAnimatedPathData + var sp = base("$SVGStringList").$SVGPathSegList; + /*readonly SVGPathSegList*/ this.pathSegList = sp.up(); + this.animatedPathSegList = this.pathSegList; + /*readonly SVGPathSegList*/ this.normalizedPathSegList = sp.up(); + sp = _doc = void 0; + this.animatedNormalizedPathSegList = this.normalizedPathSegList; + /*readonly SVGAnimatedNumber*/ this.pathLength = base("$SVGAnimatedNumber").up(); + //以下は、d属性に変更があった場合の処理 + this.addEventListener("DOMAttrModified", this._attrModi, false); + /*以下の処理は、このpath要素ノードがDOMツリーに追加されて初めて、 + *描画が開始されることを示す。つまり、appendChildで挿入されない限り、描画をしない。 + */ + this.addEventListener("DOMNodeInserted", this._nodeInsert, false); + } ) + .mix( { +_attrModi: function(evt){ var tar = evt.target; if (evt.attrName === "d" && evt.newValue !== ""){ /* d属性の値が空の場合は、描画を行わないようにする @@ -3053,8 +3054,8 @@ _sproto._attrModi = function(evt){ } } evt = tar = taco = cx = cy = xn = yn = startx = starty = tnl = tlist = ti = dii = ts = isZ = isM = isL = isC = s = tcc = tcll = void 0; -}; -_sproto._nodeInsert = function(evt){ +}, +_nodeInsert: function(evt){ var tar = evt.target; if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { return; //強制終了させる @@ -3082,8 +3083,8 @@ _sproto._nodeInsert = function(evt){ tnext = sar = spar = snext = void 0; tar.addEventListener("DOMNodeInsertedIntoDocument", tar._nodeInsertInto, false); evt = tar = void 0; -}; -_sproto._nodeInsertInto = function(evt){ +}, +_nodeInsertInto: function(evt){ /*以下の処理は、normalizedpathSegListとCTMに基づいて、 *SVGのd属性をVMLに変換していく処理である。 */ @@ -3130,8 +3131,8 @@ _sproto._nodeInsertInto = function(evt){ tt.coordsize = vi.width.baseVal.value + " " + vi.height.baseVal.value; NAIBU._setPaint(tar, matrix); tar._cacheMatrix = evt = tar = dat = t = tx = ty = matrix = tlist = x = y = mr = ma = mb = mc = md = me = mf = vi = isZ = isC = i = tli = tps = ti = cname = tt = void 0; -}; -_sproto._com = { +}, +_com: { _nameCom : { C : "c", L : "l", @@ -3156,8 +3157,8 @@ _sproto._com = { isRd : /([zZ])/g, isRe : /,/, isSp : /\S+/g -}; - /*float*/ _sproto.getTotalLength = function() { +}, + /*float*/ getTotalLength: function() { var s = 0, nl = this.normalizedPathSegList; for (var i=1,nln=nl.numberOfItems,ms=null;i