svnno****@sourc*****
svnno****@sourc*****
2010年 4月 26日 (月) 23:46:44 JST
Revision: 1803 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=1803 Author: dhrname Date: 2010-04-26 23:46:44 +0900 (Mon, 26 Apr 2010) Log Message: ----------- Modified Paths: -------------- branches/ufltima/dom/svg.js Modified: branches/ufltima/dom/svg.js =================================================================== --- branches/ufltima/dom/svg.js 2010-04-26 14:45:26 UTC (rev 1802) +++ branches/ufltima/dom/svg.js 2010-04-26 14:46:44 UTC (rev 1803) @@ -2786,37 +2786,6 @@ throw (new DOMException(DOMException.INDEX_SIZE_ERR)); } else { var s = this.ownerDocument.createSVGPoint(), t = this.firstChild; - var x = y = 0; - var h = 0, ele, fontSize = 0, isYokogaki = true; - /*変数fontSizeはCTM処理後の、fontの実際の大きさを算出するための変数。 - *つまり、CTMの行列式の2乗を掛け合わせることにより、fontの大きさにCTMを組み入れる - *以下では、charnumに位置しているfontの大きさを求めている - */ - while (t) { - if (t.nodeName === "#text") { - h += t.length; - ele = this; - } else if (t.localName === "tspan"){ - h += t.getNumberOfChars(); - ele = t; - } - if (h > charnum) { - var style = this.ownerDocument.defaultView.getComputedStyle(ele, null); - isYokogaki = ((style.getPropertyValue("writing-mode")) === "lr-tb") ? true : false; - fontSize = parseFloat(style.getPropertyValue("font-size")); - ele = null; - break; - } - } - var tend = this.getEndPositionOfChar(charnum); - if (isYokogaki) { - s.x = tend.x - fontSize; - s.y = tend.y; - } else { - s.y = tend.y - fontSize; - s.x = tend.x; - } - style = tend = null; return s; } }; @@ -2825,40 +2794,7 @@ throw (new DOMException(DOMException.INDEX_SIZE_ERR)); } else { var s = this.ownerDocument.createSVGPoint(), t = this.firstChild; - var x = y = 0; - var n = m = 0, xory; - var isYokogaki = ((style.getPropertyValue("writing-mode")) === "lr-tb") ? true : false; - var txb = this.x.baseVal, tyb = this.y.baseVal; - if (txb.numberOfItems > charnum) { - x = txb.getItem(charnum).value; - } else { - x = txb.getItem(txb.numberOfItems-1).value; - if (isYokogaki) { - x += this.getSubStringLength(txb.numberOfItems-1, charnum); - } - } - if (tyb.numberOfItems > charnum) { - y = tyb.getItem(charnum).value; - } else { - y = tyb.getItem(tyb.numberOfItems-1).value; - if (!isYokogaki) { - y += this.getSubStringLength(tyb.numberOfItems-1, charnum); - } - } - s.x = x; - s.y = y; - while (t) { - if (t.nodeName === "#text") { - m += t.length; - } else if (t.localName === "tspan"){ - var p = m; - m += t.getNumberOfChars(); - if (m > charnum) { - s = t.getEndPositionOfChar(charnum-p); - } - } - } - return s; + return s; } }; /*SVGRect*/ SVGTextContentElement.prototype.getExtentOfChar = function(/*unsigned long*/ charnum ) {