svnno****@sourc*****
svnno****@sourc*****
2009年 5月 5日 (火) 22:26:07 JST
Revision: 1133
http://svn.sourceforge.jp/view?root=sie&view=rev&rev=1133
Author: dhrname
Date: 2009-05-05 22:26:07 +0900 (Tue, 05 May 2009)
Log Message:
-----------
0.46統合
Modified Paths:
--------------
trunk/sie.js
Property Changed:
----------------
trunk/sie.js
Modified: trunk/sie.js
===================================================================
--- trunk/sie.js 2009-05-03 13:13:20 UTC (rev 1132)
+++ trunk/sie.js 2009-05-05 13:26:07 UTC (rev 1133)
@@ -80,6 +80,9 @@
NAIBU.STObject = new Objectembeds();
if (isMSIE) {
setVMLNameSpace();
+ var oba = document.createElement("div");
+ oba.setAttribute("id","_NAIBU_outline");
+ document.body.appendChild(oba);
NAIBU.STObject.next();
success = true;
} else if (/a/[-1] === 'a'){ //Firefoxだったらtrueを返す
@@ -94,14 +97,20 @@
//vmlの名前空間をセット(必須)
function setVMLNameSpace() {
- document.namespaces.add("v","urn:schemas-microsoft-com:vml");
- document.namespaces.add("o","urn:schemas-microsoft-com:office:office");
- var st = document.createStyleSheet();
- st.addRule("v\\:*","behavior: url(#default#VML);display:inline-block;");//inline-blockはIEのバグ対策
- st.addRule("o\\:*","behavior: url(#default#VML);display:inline-block");
- st.addRule("dn\\:*","display:none");
- st.addRule("v\\:group", "position:relative;width:100%;height:100%;");
- st.addRule("v\\:shape", "width:100%;height:100%;");
+ if (!document.namespaces["v"]) {
+ document.namespaces.add("v","urn:schemas-microsoft-com:vml");
+ document.namespaces.add("o","urn:schemas-microsoft-com:office:office");
+ var st = document.createStyleSheet();
+ var vmlUrl = "behavior: url(#default#VML);display:inline-block;"; //inline-blockはIEのバグ対策
+ st.addRule("v\\:rect",vmlUrl);
+ st.addRule("v\\:image",vmlUrl);
+ st.addRule("v\\:fill",vmlUrl);
+ st.addRule("v\\:stroke",vmlUrl);
+ st.addRule("o\\:opacity2",vmlUrl);
+ st.addRule("dn\\:defs","display:none");
+ st.addRule("v\\:group", vmlUrl+ "position:relative;width:100%;height:100%;");
+ st.addRule("v\\:shape", vmlUrl+ "width:100%;height:100%;");
+ }
}
//windowに指定したイベントと関数を追加
@@ -139,14 +148,14 @@
this.rootElement = obc; this.w = w; this.h = h; this.swi = swi; this.shi = shi;
return this;
}
-SVGtoVML.prototype.read = function stvread() {
+SVGtoVML.prototype.read = function stvread(/*element*/ ob) {
this.rootElement.style.visibility = "hidden";
this.vi = new STViewSpec(this.rootElement);
try{
this.children = []; //子要素
var sw = this.swi.value, sh = this.shi.value;
this.getObject("USE", STUseElement, "use", sw, sh); //use要素を先に処理
- var mat = this.vi.set(sw, sh); //返り値はMatrix型
+ var mat = this.vi.set(sw, sh, ob); //返り値はMatrix型
this.chset(this.rootElement, mat, sw, sh);
} catch(n) {stlog.add(n,109);}
}
@@ -161,57 +170,57 @@
} catch(e) {stlog.add(e,129);
}
}
-SVGtoVML.prototype.set = function stvset() {
+SVGtoVML.prototype.set = function stvset(ob) {
var w = this.w, h = this.h, c = this.children;
- var sw = this.swi.value, sh = this.shi.value;
- try {
+ var sw = this.swi.value, sh = this.shi.value;
this.setObject(this.use,sw,sh);
this.setObject(c,sw,sh);
+ try {
var backr = document.createElement("v:rect"); //背景の作成
backr.style.position = "absolute";
- backr.style.width = w;
- backr.style.height = h;
+ backr.style.width = w+ "px";
+ backr.style.height = h+ "px";
backr.style.zIndex = -1;
- backr.setAttribute("stroked", "false");
- backr.setAttribute("filled", "false");
+ backr.stroked = "false";
+ backr.filled = "false";
this.rootElement.appendChild(backr);
var trstyle = this.rootElement.style;
- var tpstyle = this.rootElement.parentNode.style;
+ var tpstyle = ob.style;
trstyle.visibility = "visible";
//以下、画像を切り取り
trstyle.overflow = "hidden";
var backrs = backr.currentStyle;
- var viewWidth = w > sw ? sw : w;
- var viewHeight = h > sh ? sh : h;
+ var viewWidth = w > sw ? sw : w, viewHeight = h > sh ? sh : h;
var bfl = parseFloat(backrs.left), bft = parseFloat(backrs.top);
- var bl = -this.vi._tx
- var bt = -this.vi._ty;
- if (bfl !== 0) { //内部の図形にずれが生じたとき
+ var bl = -this.vi._tx, bt = -this.vi._ty;
+ if (bfl !== 0 && !isNaN(bfl)) { //内部の図形にずれが生じたとき(isNaNはIE8でautoがデフォルト値のため)
bl = bfl;
- tpstyle.left = -bl;
+ tpstyle.left = -bl+ "px";
}
- if (bft !== 0) {
+ if (bft !== 0 && !isNaN(bfl)) {
bt = bft;
- tpstyle.top = -bt;
+ tpstyle.top = -bt+ "px";
}
var backright = bl + viewWidth + 1;
var backdown = bt + viewHeight + 1;
- trstyle.clip = "rect(" +bt+ " " +backright+ "px " +backdown+ "px " +bl+ ")";
+ trstyle.clip = "rect(" +bt+ "px " +backright+ "px " +backdown+ "px " +bl+ "px)";
//以下、テキストの位置を修正
var text = this.rootElement.getElementsByTagName("div");
for (var i=0,textli=text.length;i<textli;++i) {
var texti = text[i];
- var tis = texti.style;
- tis.left = parseFloat(tis.left) + bl;
- tis.top = parseFloat(tis.top) + bt;
- var tp = texti.parentNode;
- while (tp.nodeName === "group") { //group要素である限り、さかのぼる
- tp = tp.parentNode;
+ if (texti.firstChild.nodeName !== "shape") { //radialGradient用のdiv要素でないならば
+ var tis = texti.style;
+ tis.left = parseFloat(tis.left) + bl + "px";
+ tis.top = parseFloat(tis.top) + bt + "px";
+ var tp = texti.parentNode;
+ while (tp.nodeName === "group") { //group要素である限り、さかのぼる
+ tp = tp.parentNode;
+ }
+ if (tp.nodeName === "A") { //先祖要素がa要素ならば
+ tis.marginLeft = -parseFloat(tis.fontSize)+ "px";
+ tis.cursor = "hand";
+ }
}
- if (tp.nodeName === "A") { //先祖要素がa要素ならば
- tis.marginLeft = -parseFloat(tis.fontSize);
- tis.cursor = "hand";
- }
}
} catch(e) {stlog.add(e,138);}
}
@@ -343,7 +352,7 @@
STGroupElement.prototype.set = function (sw,sh) {
try{
stvsetob(this.children,sw,sh);
- this.children = null;
+ delete (this.children);
} catch(e){stlog.addd(e,3145)}
}
STGroupElement.prototype.chset = SVGtoVML.prototype.chset;
@@ -366,8 +375,8 @@
this.xlink.set();
var txts = this.xlink.tar.style;
txts.cursor = "hand";
- txts.left = 0;
- txts.top = 0;
+ txts.left = "0px";
+ txts.top = "0px";
txts.textDecoration = "none";
} catch(e) {stlog.add(e,204);}
}
@@ -402,42 +411,42 @@
if (ttp.lastChild.nodeName !== "rect") {
var backr = document.createElement("v:rect");
var backrs = backr.style; //ずれを修正するためのもの
- backrs.width = 1;
- backrs.height = 1;
- backrs.left = 0;
- backrs.top = 0;
- backr.setAttribute("stroked", "false");
- backr.setAttribute("filled", "false");
+ backrs.width = "1px";
+ backrs.height = "1px";
+ backrs.left = "0px";
+ backrs.top = "0px";
+ backr.stroked = "false";
+ backr.filled = "false";
ttp.appendChild(backr);
}
- tts.width = 0;
- tts.height = 0;
+ tts.width = "0px";
+ tts.height = "0px";
this.paint.fset(w,h,ttm);
} catch(e) {stlog.add(e,236);}
try {
//以下は、テキストの幅であるtextLengthを算出する
var arr = this.tspan, textLength = 0, fontSize = this.paint.fontSize, atfontSize = 0, fij = /[fijlt.,:;]/g; //fontSizeは親要素の文字サイズ。atfontSizeは各span要素のサイズ。
- for (var i=0,arri=arr.length;i<arri;++i) {
+ for (var i=0,s={dx:0,dy:0},arri=arr.length;i<arri;++i) {
var ari = arr[i];
ari.paint.fset(w,h,ari.transformable);
var atps = ari.tar.previousSibling;
if (atps && atps !== void 0) {
if (atps.nodeType === 3) { //tspan要素の前がText Nodeならば
var ad = atps.data;
- var alm = ad.match(fij) ? ad.match(fij).length : 0; //iなどはカーニング調整をする
+ var alm = fij.test(ad) ? ad.match(fij).length : 0; //iなどはカーニング調整をする
textLength += (2 * ad.length - alm) * fontSize / 2;
} else {
var ai = atps.innerText;
- var alm = ai.match(fij) ? ai.match(fij).length : 0;
+ var alm = fij.test(ad) ? ai.match(fij).length : 0;
textLength += (2 * ai.length - alm) * atfontSize / 2;
}
}
atfontSize = ari.paint.fontSize;
- ari.set(w,h,textLength);
+ s = ari.set(w,h,s);
}
if (arr.length === 0) { //tspan要素がなければ
var tti = this.tar.innerText;
- var alm = tti.match(fij) ? tti.match(fij).length : 0;
+ var alm = fij.test(tti) ? tti.match(fij).length : 0;
textLength = (2 * tti.length - alm) * fontSize / 2;
}
//以下はtext-anchorプロパティをサポートする。
@@ -454,8 +463,8 @@
}
tts.left = ptm.x - tancx;
tts.top = ptm.y - tancy;
- p = ptm = tancx = tancy = null;
- this.textLength = textLength;
+ p = ptm = tancx = tancy = null;
+ this.textLength = textLength;
} catch(e) {stlog.add(e,2831);}
p = ptm = tancx = tancy = null;
this.textLength = textLength;
@@ -482,21 +491,24 @@
this.transformable = NAIBU.transformToCTM(ele, matrix);
return this;
}
-STTSpanElement.prototype.set = function(w, h, textLength) {
+//ddはずれの値を持つオブジェクトをあらわす
+STTSpanElement.prototype.set = function(w, h, dd) {
try {
var tts = this.tar.style;
tts.position = "relative";
- tts.left = this.dx ? this.dx.value : 0;
- tts.top = this.dy ? this.dy.value : 0;
+ tts.left = (this.dx ? this.dx.value : 0) + dd.dx+ "px";
+ tts.top = (this.dy ? this.dy.value : 0) + dd.dy+ "px";
var p, ptm;
if (this.x && this.y) { //x属性とy属性が指定されていたならば(注:仕様と相違がある可能性?)。
p = new Point(this.x.value, this.y.value);
ptm = p.matrixTransform(this.transformable);
tts.position = "absolute";
- tts.left = ptm.x;
- tts.top = ptm.y;
+ tts.left = ptm.x+ "px";
+ tts.top = ptm.y+ "px";
}
p = ptm = null;
+ //ずれの値を返す
+ return {dx : parseFloat(tts.left), dy : parseFloat(tts.top)}
} catch(e) {stlog.add(e,304);}
}
@@ -519,8 +531,8 @@
var plm = pl.matrixTransform(ttm);
var dat = plm.list.join(" ");
var ele = this.tar;
- ele.setAttribute("path", dat);
- ele.setAttribute("coordsize", w + " " + h);
+ ele.path = dat;
+ ele.coordsize = w + " " + h;
this.paint.set(w, h, ttm);
list = pl = plm = dat = null;
} catch(e) {stlog.add(e,257);}
@@ -608,7 +620,7 @@
var Fli = F.length;
x = F[Fli-2];
y = F[Fli-1];
- var _x, _y;
+ var _x, _y; //この変数は初期化されないために必要
for (var j = 1; j < Fli; j += 2) { //CTMで座標変換
_x = parseInt(tma * F[j] + tmc * F[j+1] + tme, 10);
_y = parseInt(tmb * F[j] + tmd * F[j+1] + tmf, 10);
@@ -626,8 +638,8 @@
} catch(e) {if(this.d == ""){/*d属性が空*/}else{stlog.add(e,355);}}
try {
var ele = this.tar;
- ele.setAttribute("path", dat + " e");
- ele.setAttribute("coordsize", w + " " + h);
+ ele.path = dat + " e";
+ ele.coordsize = w + " " + h;
this.paint.set(w, h, ttm);
dat = this.paint = this.d = preCom = x = y = x0 = y0 = dx = dy = tma = tmb = tmc = tmd = tme = tmf = null; //解放
} catch(e) {stlog.add(e,372);}
@@ -692,8 +704,8 @@
} catch(e) {stlog.add(e,395);}
try {
var ele = this.tar;
- ele.setAttribute("path", dat);
- ele.setAttribute("coordsize", w + " " + h);
+ ele.path = dat;
+ ele.coordsize = w + " " + h;
this.paint.set(w, h, ttm);
} catch(e) {stlog.add(e,406);}
}
@@ -718,8 +730,8 @@
} catch(e) {stlog.add(e,429);}
try {
var ele = this.tar;
- ele.setAttribute("path", dat);
- ele.setAttribute("coordsize", w + " " + h);
+ ele.path = dat;
+ ele.coordsize = w + " " + h;
this.paint.set(w, h, ttm);
} catch(e) {stlog.add(e,440);}
}
@@ -750,8 +762,8 @@
} catch(e) {stlog.add(e,468);}
try {
var ele = this.tar;
- ele.setAttribute("path", dat);
- ele.setAttribute("coordsize", w + " " + h);
+ ele.path = dat;
+ ele.coordsize = w + " " + h;
this.paint.set(w, h, ttm);
} catch(e) {stlog.add(e,479);}
}
@@ -782,8 +794,8 @@
} catch(e) {stlog.add(e,508);}
try {
var ele = this.tar;
- ele.setAttribute("path", dat);
- ele.setAttribute("coordsize", w + " " + h);
+ ele.path = dat;
+ ele.coordsize = w + " " + h;
this.paint.set(w, h, ttm);
} catch(e) {stlog.add(e,519);}
}
@@ -832,8 +844,8 @@
} catch(e) {stlog.add(e,564);}
try {
var ele = this.tar;
- ele.setAttribute("path", dat);
- ele.setAttribute("coordsize", w + " " + h);
+ ele.path = dat;
+ ele.coordsize = w + " " + h;
this.paint.set(w, h, ttm);
} catch(ee) {stlog.add(ee,576);}
}
@@ -858,10 +870,10 @@
ts.position = "absolute";
var pt = new Point(this.x.value, this.y.value);
var ptt = pt.matrixTransform(ttm);
- ts.left = ptt.x;
- ts.top = ptt.y;
- ts.width = this.width.value * ttm.a;
- ts.height = this.height.value * ttm.d;
+ ts.left = ptt.x+ "px";
+ ts.top = ptt.y+ "px";
+ ts.width = this.width.value * ttm.a+ "px";
+ ts.height = this.height.value * ttm.d+ "px";
if (ttm.b !== 0 || ttm.c !== 0 || this.paint.fillopacity != 1) {//フィルター プロパティを使うと、PNGの透過性がなくなるので注意
ts.filter = "progid:DXImageTransform.Microsoft.Matrix progid:DXImageTransform.Microsoft.Alpha";
var ttfi = this.tar.filters.item('DXImageTransform.Microsoft.Matrix');
@@ -892,7 +904,7 @@
this.xlink.set();
tns.setAttribute("transform", ts+ " translate(" +this.x.value+ "," +this.y.value+ ")");
tns.firstChild.setAttribute("id","");
- tns.setAttribute("coordorgin","0 0");
+ tns.coordorgin = "0 0";
this.paint = new NAIBU.PaintColor(this.xlink.resource);
this.paint.tar = tns;
return this;
@@ -900,6 +912,7 @@
STUseElement.prototype.set = function(){
try {
this.paint.setStyle();
+ this.paint = this.xlink = null;
} catch(e) {stlog.add(e,85436);}
}
@@ -993,14 +1006,14 @@
NAIBU.PaintColor.prototype.set = function pcset(/*float*/ w, /*float*/ h, /*Matrix*/ matrix) {
var el = this.tar;
if (this.fill === "none") {
- el.setAttribute("filled", "false");
+ el.filled = "false";
} else {
var fillElement = document.createElement("v:fill");
var isRadial = false;
try {
if (this._urlreg.test(this.fill)) { //fill属性の値がurl(#id)ならば、idを設定したグラデーション関連要素を呼び出す
this.w = w; this.h = h; //radialGradientで必要
- isRadial = this.gradient(fillElement, RegExp.$1, el.getAttribute("path"), el.currentStyle.width, el.currentStyle.height);
+ isRadial = this.gradient(fillElement, RegExp.$1, matrix);
} else {
fillElement.setAttribute("color", this.color(this.fill));
var fillOpacity = this.fillopacity * this.opacity; //opacityを掛け合わせる
@@ -1008,15 +1021,15 @@
fillElement.setAttribute("opacity", fillOpacity);
}
}
- } catch(e) {stlog.add(e,682); fillElement.setAttribute("on", "true");
- fillElement.setAttribute("color", "black");}
+ } catch(e) {stlog.add(e,682); fillElement.on = "true";
+ fillElement.color = "black";}
if (!isRadial) {
el.appendChild(fillElement);
}
isRadial = fillOpacity = null;
}
if (this.stroke === "none") {
- el.setAttribute("stroked", "false");
+ el.stroked = "false";
} else {
var strokeElement = document.createElement("v:stroke");
try {
@@ -1056,7 +1069,7 @@
}
strokeElement.setAttribute("dashstyle", this.strokedasharray);
}
- } catch(e) {stlog.add(e,720); strokeElement.setAttribute("on", "false");}
+ } catch(e) {stlog.add(e,720); strokeElement.on = "false";}
el.appendChild(strokeElement);
sw = tsd = null;
}
@@ -1211,7 +1224,7 @@
return color;
}
//linearGradient、radialGradient要素を処理
-NAIBU.PaintColor.prototype.gradient = function pcgradient( /*element*/ ele, /*string*/ id, /*string*/ data) {
+NAIBU.PaintColor.prototype.gradient = function pcgradient( /*element*/ ele, /*string*/ id, /*Matrix*/ matrix) {
var grad = document.getElementById(id);
if (grad) {
var grad2 = grad;
@@ -1221,7 +1234,7 @@
}
var stops = grad2.getElementsByTagName("stop");
if (!stops) {
- return;
+ return false;
}
var length = stops.length;
var color = [], colors = [], opacity = [];
@@ -1259,44 +1272,57 @@
ele.setAttribute("type", "gradientTitle");
ele.setAttribute("focus", "100%");
ele.setAttribute("focusposition", "0.5 0.5");
+ if (this.tar.getAttribute("tag") === "rect") {
var cx = parseFloat((grad.getAttribute("cx") || "0.5").replace(/%/, ""));
var cy = parseFloat((grad.getAttribute("cy") || "0.5").replace(/%/, ""));
var r = rx = ry = parseFloat((grad.getAttribute("r") || "0.5").replace(/%/, ""));
var el = this.w, et = this.h, er = 0, eb = 0;
+ var data = this.tar.getAttribute("path")+"";
var units = grad.getAttribute("gradientUnits");
if (!units || units === "objectBoundingBox") {
//%の場合は小数点に変換(10% -> 0.1)
cx = cx > 1 ? cx/100 : cx; cy = cy > 1 ? cy/100 : cy; r = r > 1 ? r/100 : r;
//要素の境界領域を求める(四隅の座標を求める)
- var degis = (this.tar.getAttribute("path")+"").match(/[0-9\-]+/g);
+ var degis = data.match(/[0-9\-]+/g);
for (var i=0,degisli=degis.length;i<degisli;i+=2) {
var nx = parseInt(degis[i]), ny = parseInt(degis[i+1]);
el = el > nx ? nx : el;
et = et > ny ? ny : et;
er = er > nx ? er : nx;
- eb = eb > ny ? eb : ny;
+ eb = eb > ny ? eb : ny; nx = ny = null;
}
degis = null;
cx = cx*(er - el) + el; cy = cy*(eb - et) + et; rx = r*(er - el); ry = r*(eb - et);
}
+ var gt = grad.getAttribute("gradientTransform");
+ if (gt) {
+ grad.setAttribute("transform",gt);
+ matrix = NAIBU.transformToCTM(grad, matrix);
+ }
el = cx - rx; et = cy - ry; er = cx + rx; eb = cy + ry;
+ var rrx = rx * 0.55228, rry = ry * 0.55228;
+ var list = ["m", cx,et, "c", cx-rrx,et, el,cy-rry, el,cy, el,cy+rry, cx-rrx,eb, cx,eb, cx+rrx,eb, er,cy+rry, er,cy, er,cy-rry, cx+rrx,et, cx,et, "x e"];
+ var pl = new PList(list);
+ var plm = pl.matrixTransform(matrix);
+ var ellipse = plm.list.join(" ");
var outline = document.getElementById("_NAIBU_outline");
var background = document.createElement("div");
background.style.position = "absolute";
- background.style.textAlign = "left"; background.style.top = 0; background.style.left = 0; background.style.width = this.w; background.style.height = this.h;
+ background.style.textAlign = "left"; background.style.top = "0px"; background.style.left = "0px"; background.style.width = this.w+ "px"; background.style.height = this.h+ "px";
outline.appendChild(background);
background.style.filter = "progid:DXImageTransform.Microsoft.Compositor";
background.filters.item('DXImageTransform.Microsoft.Compositor').Function = 23;
- var er2 = er - el / 2;
- var ellipse = "ar " +el+ "," +et+ "," +er+ "," +eb+ " " +er2+ ",0 " +er2+ ",0 e";
var circle = '<v:shape style="position:relative; antialias:false; top:0px; left:0px;" coordsize="' +this.w+ ' ' +this.h+ '" path="' +ellipse+ '" stroked="f">' +ele.outerHTML+ '</v:shape>';
- background.innerHTML = '<v:shape style="position:relative; top:0px; left:0px;" coordsize="' +this.w+ ' ' +this.h+ '" path="' +data+ '" stroked="f" fillcolor="' +color[color.length-1]+ '" />';
+ background.innerHTML = '<v:shape style="position:relative; top:0px; left:0px;" coordsize="' +this.w+ ' ' +this.h+ '" path="' +data+ '" stroked="f" fillcolor="' +color[color.length-1]+ '" ></v:shape>';
background.filters[0].apply();
background.innerHTML = circle;
background.filters[0].play();
this.tar.parentNode.insertBefore(background, this.tar);
- this.tar.setAttribute("filled", "false");
- ellipse = circle = null;
+ this.tar.filled = "false";
+ ellipse = circle = data = list = pl = plm = gt = cx = cy = r = null;
+ } else {
+ return false;
+ }
return true;
} catch(e) {stlog.add(e,1175);}
}
@@ -1365,10 +1391,11 @@
var tts = this.tar.style;
tts.whiteSpace = "nowrap";
tts.color = this.fill === "none" ? "transparent" : this.fill;
- this.fontSize = tts.fontSize = fontset(this["font-size"],w,h,matrix);
+ this.fontSize = fontset(this["font-size"],w,h,matrix);
+ tts.fontSize = this.fontSize+ "px";
if (this.cursor !== "default") {tts.cursor = this.cursor;}
this.writingMode = tts.writingMode;
- tts.marginTop = (this.writingMode === "tb-rl") ? 0 : -parseFloat(tts.fontSize);
+ tts.marginTop = (this.writingMode === "tb-rl") ? "0px" : -parseFloat(tts.fontSize)+ "px";
} catch(e){stlog.add(e,1185);}
}
@@ -1523,7 +1550,7 @@
vb = par = null;
return this;
}
-STViewSpec.prototype.set = function vss( /*float*/ vw, /*float*/ vh) {
+STViewSpec.prototype.set = function vss( /*float*/ vw, /*float*/ vh, /*element*/ ob) {
var vB = this.viewBox, par = this.preserveAspectRatio;
try {
if (!vB) {
@@ -1572,9 +1599,11 @@
break;
}
}
- var ttps = this.tar.parentNode.style;
- ttps.marginLeft = this._tx = tx;
- ttps.marginTop = this._ty = ty;
+ var ttps = ob.style;
+ this._tx = tx;
+ this._ty = ty;
+ ttps.marginLeft = this._tx+ "px";
+ ttps.marginTop = this._ty+ "px";
var m = new Matrix(xr, 0, 0, yr, 0, 0);
return m;
} catch(e) {stlog.add(e,1031);}
@@ -1762,16 +1791,14 @@
NAIBU.XLink.prototype.set = function() {
try {
if (this.href) {
- var tbth = this.base + this.href;
+ var uri = this.base + this.href;
if (this.href.indexOf(".") === 0) { //相対URIの場合
- tbth = this.href;
+ uri = this.href;
}
- var uri = tbth;
- var attr = "href";
switch (this.show) {
case "embed":
if (this.tar.tagName === "image") {
- attr = "src";
+ this.tar.src = uri;
} else{
uri.match(/#(.+)$/);
this.resource = document.getElementById(RegExp.$1);
@@ -1785,7 +1812,7 @@
default:
break;
}
- this.tar.setAttribute(attr,uri);
+ this.tar.setAttribute("href",uri);
}
} catch(e) {stlog.add(e,17155);}
}
@@ -1896,18 +1923,18 @@
regw = new STLength(regaw,obwidth);
regh = new STLength(regah,obheight);
var regwv = regw.value, reghv = regh.value;
- obst.width = regwv;
- obst.height = reghv;
- ob.setAttribute("coordsize",regwv +" "+ reghv);
+ obst.width = regwv+ "px";
+ obst.height = reghv+ "px";
+ ob.coordsize = regwv +" "+ reghv;
var oba = document.createElement("div");
oba.setAttribute("id","_NAIBU_outline");
obj.parentNode.appendChild(oba);
STdocument[dn] = new SVGtoVML(obc,obwidth,obheight,regw,regh);
obj.parentNode.insertBefore(ob,obj);
- STdocument[dn].read();
- STdocument[dn].set();
+ STdocument[dn].read(ob);
+ STdocument[dn].set(ob);
+ data = dc = null;
if (NAIBU.STObject !== void 0) {NAIBU.STObject.next();}
- data = dc = null;
}
}
Property changes on: trunk/sie.js
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/04x/040/sie.js:812-829
/branches/04x/041/sie.js:891-923
/branches/04x/042/sie.js:927-967
/branches/04x/043/sie.js:969-1013
/branches/04x/044/sie.js:1015-1067
/branches/04x/045/sie.js:1069-1078
/branches/04x/sie.js:830-1084
+ /branches/04x/040/sie.js:812-829
/branches/04x/041/sie.js:891-923
/branches/04x/042/sie.js:927-967
/branches/04x/043/sie.js:969-1013
/branches/04x/044/sie.js:1015-1067
/branches/04x/045/sie.js:1069-1078
/branches/04x/046/sie.js:1080-1129
/branches/04x/sie.js:830-1132