svnno****@sourc*****
svnno****@sourc*****
2011年 3月 21日 (月) 20:19:24 JST
Revision: 2495
http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2495
Author: dhrname
Date: 2011-03-21 20:19:24 +0900 (Mon, 21 Mar 2011)
Log Message:
-----------
SVGSVGElementのgetScreenCTMメソッドのvar文について整理
Modified Paths:
--------------
branches/07x/073/org/w3c/dom/svg.js
Modified: branches/07x/073/org/w3c/dom/svg.js
===================================================================
--- branches/07x/073/org/w3c/dom/svg.js 2011-03-21 11:12:45 UTC (rev 2494)
+++ branches/07x/073/org/w3c/dom/svg.js 2011-03-21 11:19:24 UTC (rev 2495)
@@ -1278,21 +1278,32 @@
if (!!this._cacheScreenCTM) { //キャッシュがあれば
return (this._cacheScreenCTM);
}
- var vw = this.viewport.width, vh = this.viewport.height;
+ var vw = this.viewport.width,
+ vh = this.viewport.height,
+ vB, par, m, vbx, vby, vbw, vbh, rw, rh, xr, yr, tx, ty, ttps;
if (!this.useCurrentView) {
- var vB = this.viewBox.baseVal, par = this.preserveAspectRatio.baseVal;
+ vB = this.viewBox.baseVal;
+ par = this.preserveAspectRatio.baseVal;
} else {
- var vB = this.currentView.viewBox.baseVal, par = this.currentView.preserveAspectRatio.baseVal;
+ vB = this.currentView.viewBox.baseVal;
+ par = this.currentView.preserveAspectRatio.baseVal;
}
if (!!!vB._isUsed) { //viewBox属性が指定されていなければ
this._tx = this._ty = 0;
- var m = this.createSVGMatrix();
+ m = this.createSVGMatrix();
this._cacheScreenCTM = m; //キャッシュを作っておく
return m;
} else {
- var vbx = vB.x, vby = vB.y, vbw = vB.width, vbh = vB.height;
- var rw = vw / vbw, rh = vh / vbh;
- var xr = 1, yr = 1, tx = 0, ty = 0;
+ vbx = vB.x;
+ vby = vB.y;
+ vbw = vB.width;
+ vbh = vB.height;
+ rw = vw / vbw;
+ rh = vh / vbh;
+ xr = 1;
+ yr = 1;
+ tx = 0;
+ ty = 0;
if (par.align === 1) { //none
xr = rw;
yr = rh;
@@ -1336,13 +1347,14 @@
//text要素の位置調整に使うため、ここで、viewの移動量を記録しておく
this._tx = tx;
this._ty = ty;
- var ttps = this._tar.style;
+ ttps = this._tar.style;
ttps.marginLeft = tx+ "px";
ttps.marginTop = ty+ "px";
- var m = this.createSVGMatrix();
+ m = this.createSVGMatrix();
m.a = xr;
m.d = yr;
this._cacheScreenCTM = m; //キャッシュを作っておく
+ vw = vh = vB = par = vbx = vby = vbw = vbh = rw = rh = xr = yr = tx = ty = ttps = null;
return m;
};