[Sie-announce] SIEコード [1772] 画像の切り取りや大きさの修正

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 4月 1日 (木) 21:06:16 JST


Revision: 1772
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=1772
Author:   dhrname
Date:     2010-04-01 21:06:16 +0900 (Thu, 01 Apr 2010)

Log Message:
-----------
画像の切り取りや大きさの修正

Modified Paths:
--------------
    branches/ufltima/dom/svg.js

Modified: branches/ufltima/dom/svg.js
===================================================================
--- branches/ufltima/dom/svg.js	2010-03-31 14:46:18 UTC (rev 1771)
+++ branches/ufltima/dom/svg.js	2010-04-01 12:06:16 UTC (rev 1772)
@@ -1170,12 +1170,17 @@
             doc.loadXML(str);
             var s = DOMImplementation.createDocument("http://www.w3.org/2000/svg", "svg");
             var tar = s.documentElement;
-            var sdt = tar._tar;
-            document.body.insertBefore(sdt, document.body.lastChild);
+            var sdt = tar._tar, sp = document.createElement("div"), dcp = document.createElement("v:group");
+            dcp.style.width = "1237px";
+            dcp.style.height = "800px";
+            dcp.coordsize = "1237 800";
+            sp.appendChild(dcp);
+            document.body.insertBefore(sp, document.body.lastChild);
+            dcp.appendChild(sdt)
             tar.viewport.top = 0;
             tar.viewport.left = 0;
-            tar.width.baseVal.value = tar.viewport.width = 1000;
-            tar.height.baseVal.value = tar.viewport.height = 1000;
+            tar.width.baseVal.value = tar.viewport.width = 1237;
+            tar.height.baseVal.value = tar.viewport.height = 800;
             var fi = doc.documentElement.firstChild, n;
             var attr = tar.attributes, att;
             for (var i=0,atli=attr.length;i<atli;++i) { //NamedNodeMapを検索する
@@ -1209,14 +1214,6 @@
             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;
-              tpstyle.left = -bl+ "px";
-            }
-            if (bft !== 0 && !isNaN(bfl)) {
-              bt = bft;
-              tpstyle.top = -bt+ "px";
-            }
             var backright = bl + viewWidth + 1;
             var backdown = bt + viewHeight + 1;
             trstyle.clip = "rect(" +bt+ "px " +backright+ "px " +backdown+ "px " +bl+ "px)";
@@ -1996,8 +1993,8 @@
           dat += y;
         }
       }
-      var vi = tar.ownerDocument.documentElement.viewport;
-      var w = vi.width, h = vi.hight;
+      var vi = tar.ownerDocument.documentElement;
+      var w = vi.width.baseVal.value, h = vi.height.baseVal.value;
       tar._tar.path = dat + " e";
       tar._tar.coordsize = w + " " + h;
       /*以下では、スタイルシートを用いて、fill-とstroke-関連の




Sie-announce メーリングリストの案内
Back to archive index