svnno****@sourc*****
svnno****@sourc*****
2010年 9月 8日 (水) 23:07:34 JST
Revision: 1993 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=1993 Author: dhrname Date: 2010-09-08 23:07:34 +0900 (Wed, 08 Sep 2010) Log Message: ----------- GetSVGDocumentの図形のずれに関する修正 Modified Paths: -------------- branches/06x/061/org/w3c/dom/svg.js Modified: branches/06x/061/org/w3c/dom/svg.js =================================================================== --- branches/06x/061/org/w3c/dom/svg.js 2010-09-08 13:38:41 UTC (rev 1992) +++ branches/06x/061/org/w3c/dom/svg.js 2010-09-08 14:07:34 UTC (rev 1993) @@ -1513,9 +1513,24 @@ var viewWidth = w > sw ? sw : w, viewHeight = h > sh ? sh : h; var bfl = parseFloat(backrs.left), bft = parseFloat(backrs.top); var bl = -tar._tx, bt = -tar._ty; + if (bfl !== 0 && !isNaN(bfl)) { //内部の図形にずれが生じたとき(isNaNはIE8でautoがデフォルト値のため) + bl = bfl; + dcp.style.left = -bl+ "px"; + } + if (bft !== 0 && !isNaN(bfl)) { + bt = bft; + dcp.style.top = -bt+ "px"; + } var backright = bl + viewWidth + 1; var backdown = bt + viewHeight + 1; trstyle.clip = "rect(" +bt+ "px " +backright+ "px " +backdown+ "px " +bl+ "px)"; + //以下、テキストの位置を修正 + var text = tar._tar.getElementsByTagName("div"); + for (var i=0,textli=text.length;i<textli;++i) { + var tis = text[i].style; + tis.left = parseFloat(tis.left) + bl + "px"; + tis.top = parseFloat(tis.top) + bt + "px"; + } this._document = s; if (!!s._svgload_limited) { /*_svgload_limitedプロパティはXlink言語が使われていない限り、0である。 @@ -3411,14 +3426,13 @@ tar._tar.style.fontSize = n + "px"; tar._tar.style.fontFamily = style.getPropertyValue("font-family"); var tod = tar.ownerDocument.documentElement; - var tx = tod._tx, ty = tod._ty; for (var i=0, j=0, tli=tar.getNumberOfChars();i<tli;++i) { if (ti) { var p = tar.getStartPositionOfChar(i-j); if (!!ti._tar) { var sty = ti._tar[i].style; - sty.left = p.x - tx + "px"; - sty.top = p.y - ty + "px"; + sty.left = p.x + "px"; + sty.top = p.y + "px"; sty.width = "0px"; sty.height = "0px"; sty.marginTop = tar._isYokogaki ? -n+ "px" : "0px";