svnno****@sourc*****
svnno****@sourc*****
2011年 8月 28日 (日) 21:58:48 JST
Revision: 2896 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2896 Author: dhrname Date: 2011-08-28 21:58:47 +0900 (Sun, 28 Aug 2011) Log Message: ----------- svg要素のwidthとheight属性がフレーム枠よりも小さい場合は、画像の切り取りが必要になるため、0.83で外したクリップ処理を復活させた Modified Paths: -------------- branches/08x/084/org/w3c/dom/svg.js Modified: branches/08x/084/org/w3c/dom/svg.js =================================================================== --- branches/08x/084/org/w3c/dom/svg.js 2011-08-27 12:02:49 UTC (rev 2895) +++ branches/08x/084/org/w3c/dom/svg.js 2011-08-28 12:58:47 UTC (rev 2896) @@ -1730,7 +1730,7 @@ s = DOMImplementation.createDocument("http://www.w3.org/2000/svg", "svg"), tar = s.documentElement, tview = tar.viewport, - objw, objh, fi, n, attr, att, + objw, objh, fi, n, attr, att, w, h, sdt = tar._tar, sp = _doc.createElement("div"), dcp = _doc.createElement("v:group"), @@ -1831,8 +1831,10 @@ sw = tar.width.baseVal.value; sh = tar.height.baseVal.value; backr.style.position = "absolute"; - backr.style.width = tview.width+ "px"; - backr.style.height = tview.height+ "px"; + w = tview.width; + h = tview.height; + backr.style.width = w+ "px"; + backr.style.height = h+ "px"; backr.style.zIndex = -1; backr.stroked = "false"; backr.filled = "false"; @@ -1841,7 +1843,11 @@ tpstyle = objei.style; trstyle.visibility = "visible"; trstyle.position = "absolute"; + /*以下、画像を切り取り*/ trstyle.overflow = "hidden"; + /*ウィンドウ枠の長さを決定する*/ + viewWidth = w > sw ? sw : w; + viewHeight = h > sh ? sh : h; backrs = backr.currentStyle; bfl = _parseFloat(backrs.left); bft = _parseFloat(backrs.top); @@ -1855,7 +1861,9 @@ bt = bft; dcp.style.top = -bt+ "px"; } - this._document = s; + backright = bl + viewWidth + 1; + backdown = bt + viewHeight + 1; + trstyle.clip = "rect(" +bt+ "px " +backright+ "px " +backdown+ "px " +bl+ "px)"; this._document = s; if ("_svgload_limited" in s.documentElement) { /*_svgload_limitedプロパティはXlink言語が使われていない限り、0である。 *xlink:href属性が指定されるたびに+1となる。