style = tar.ownerDocument.defaultView.getComputedStyle(tar, null),\r
deter = Math.sqrt(Math.abs(tar.getScreenCTM()._determinant())),\r
n = parseFloat(style.getPropertyValue("font-size")) * deter,\r
+ mt = -n-5+ "px",\r
+ lh = n+10+ "px",\r
tod = tar.ownerDocument.documentElement,\r
ttpc = ttp, //ttpcはttpのキャッシュ\r
tlen = tar.getComputedTextLength(),\r
anchor = style.getPropertyValue("text-anchor"),\r
+ isMiddle = (anchor === "middle"),\r
+ isEnd = (anchor === "end"),\r
tedeco = style.getPropertyValue("text-decoration"), //text-decorationは継承しないので、個々に設定する\r
ttps = ttp.style,\r
ae = [],\r
p = tar.getStartPositionOfChar(i);\r
sty.position = "absolute";\r
if (tar._isYokogaki) {\r
- if (anchor === "middle") {\r
+ if (isMiddle) {\r
p.x -= tlen / 2;\r
- } else if (anchor === "end") {\r
+ } else if (isEnd) {\r
p.x -= tlen;\r
}\r
} else {\r
- if (anchor === "middle") {\r
+ if (isMiddle) {\r
p.y -= tlen / 2;\r
- } else if (anchor === "end") {\r
+ } else if (isEnd) {\r
p.y -= tlen;\r
}\r
}\r
sty.left = p.x + "px";\r
sty.top = p.y + "px";\r
- sty.width = "0px";\r
- sty.height = "0px";\r
- sty.marginTop = tar._isYokogaki ? -n-5+ "px" : "-5px";\r
- sty.lineHeight = n+10+ "px";\r
+ sty.width = sty.height = "0px";\r
+ sty.marginTop = tar._isYokogaki ? mt : "-5px";\r
+ sty.lineHeight = lh;\r
sty.textDecoration = tedeco;\r
sty.display = "none";\r
ttp.appendChild(ti._tars[ij]);\r
++j;\r
}\r
delete tar._cacheMatrix;\r
- tftfunc = ae = isRect = evt = tar = style = tedeco = tpp = ttpc = style = color = cursor = disp = vis = ttps = backr = backrs = di = tft = jt = lts = deter = void 0;\r
+ anchor = isEnd = isMiddle = mt = lh = tftfunc = ae = isRect = evt = tar = style = tedeco = tpp = ttpc = style = color = cursor = disp = vis = ttps = backr = backrs = di = tft = jt = lts = deter = void 0;\r
};\r
\r
function SVGTextElement(_doc) {\r