svnno****@sourc*****
svnno****@sourc*****
2010年 1月 15日 (金) 21:06:13 JST
Revision: 1577 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=1577 Author: dhrname Date: 2010-01-15 21:06:12 +0900 (Fri, 15 Jan 2010) Log Message: ----------- Modified Paths: -------------- branches/05x/058/sie.js Modified: branches/05x/058/sie.js =================================================================== --- branches/05x/058/sie.js 2010-01-15 11:56:36 UTC (rev 1576) +++ branches/05x/058/sie.js 2010-01-15 12:06:12 UTC (rev 1577) @@ -817,8 +817,6 @@ var plm = pl.matrixTransform(ttm); plm.list.splice(2, 0, "l"); dat = "m" + plm.list.join(" ") + "x e"; - } catch(e) {stlog.add(e,395);} - try { var ele = this.tar; ele.path = dat; ele.coordsize = w + " " + h; @@ -843,8 +841,6 @@ var plm = pl.matrixTransform(ttm); plm.list.splice(2, 0, "l"); dat = "m" + plm.list.join(" ") + "e"; - } catch(e) {stlog.add(e,429);} - try { var ele = this.tar; ele.path = dat; ele.coordsize = w + " " + h; @@ -876,13 +872,11 @@ var cx = this.cx.value, cy = this.cy.value, rx = ry = this.r.value; var top = cy - ry, left = cx - rx, bottom = cy + ry, right = cx + rx; try { - var rrx = rx * 0.55228, rry = ry * 0.55228; - var list = ["m", cx,top, "c", cx-rrx,top, left,cy-rry, left,cy, left,cy+rry, cx-rrx,bottom, cx,bottom, cx+rrx,bottom, right,cy+rry, right,cy, right,cy-rry, cx+rrx,top, cx,top, "x e"]; - var pl = new PList(list); - var plm = pl.matrixTransform(ttm); - var dat = plm.list.join(" "); - } catch(e) {stlog.add(e,468);} - try { + var rrx = rx * 0.55228, rry = ry * 0.55228; + var list = ["m", cx,top, "c", cx-rrx,top, left,cy-rry, left,cy, left,cy+rry, cx-rrx,bottom, cx,bottom, cx+rrx,bottom, right,cy+rry, right,cy, right,cy-rry, cx+rrx,top, cx,top, "x e"]; + var pl = new PList(list); + var plm = pl.matrixTransform(ttm); + var dat = plm.list.join(" "); var ele = this.tar; ele.path = dat; ele.coordsize = w + " " + h; @@ -894,15 +888,13 @@ //ellipse要素を処理 function STEllipse( /*element*/ ele, /*Matrix*/ matrix, /*float*/w, h) { this.tar = ele; - try { - this.cx = new STLength((ele.getAttribute("cx") || 0), w); - this.cy = new STLength((ele.getAttribute("cy") || 0), h); - this.rx = new STLength(ele.getAttribute("rx"), w); - this.ry = new STLength(ele.getAttribute("ry"), h); - this.paint = new NAIBU.PaintColor(ele); - this.transformable = NAIBU.transformToCTM(ele,matrix); - w = h = null; - } catch(e) {stlog.add(e,490);} + this.cx = new STLength((ele.getAttribute("cx") || 0), w); + this.cy = new STLength((ele.getAttribute("cy") || 0), h); + this.rx = new STLength(ele.getAttribute("rx"), w); + this.ry = new STLength(ele.getAttribute("ry"), h); + this.paint = new NAIBU.PaintColor(ele); + this.transformable = NAIBU.transformToCTM(ele,matrix); + w = h = null; return this; } STEllipse.prototype.set = function elliset(w,h) { @@ -915,13 +907,11 @@ var cx = this.cx.value, cy = this.cy.value, rx = this.rx.value, ry = this.ry.value; var top = cy - ry, left = cx - rx, bottom = cy + ry, right = cx + rx; try { - var rrx = rx * 0.55228, rry = ry * 0.55228; - var list = ["m", cx,top, "c", cx-rrx,top, left,cy-rry, left,cy, left,cy+rry, cx-rrx,bottom, cx,bottom, cx+rrx,bottom, right,cy+rry, right,cy, right,cy-rry, cx+rrx,top, cx,top, "x e"]; - var pl = new PList(list); - var plm = pl.matrixTransform(ttm); - var dat = plm.list.join(" "); - } catch(e) {stlog.add(e,508);} - try { + var rrx = rx * 0.55228, rry = ry * 0.55228; + var list = ["m", cx,top, "c", cx-rrx,top, left,cy-rry, left,cy, left,cy+rry, cx-rrx,bottom, cx,bottom, cx+rrx,bottom, right,cy+rry, right,cy, right,cy-rry, cx+rrx,top, cx,top, "x e"]; + var pl = new PList(list); + var plm = pl.matrixTransform(ttm); + var dat = plm.list.join(" "); var ele = this.tar; ele.path = dat; ele.coordsize = w + " " + h; @@ -933,26 +923,24 @@ //rect要素を処理 function STRectElement( /*element*/ rect, /*Matrix*/ matrix, /*float*/ w, h) { this.tar = rect; - try { - this.x = new STLength((rect.getAttribute("x") || 0), w); - this.y = new STLength((rect.getAttribute("y") || 0), h); - this.width = new STLength(rect.getAttribute("svgwidth"), w); - this.height = new STLength(rect.getAttribute("svgheight"), h); - var rx = rect.getAttribute("rx"), ry = rect.getAttribute("ry"); - if (rx || ry) { - this.rx = new STLength((rx || ry), w); - this.ry = new STLength((ry || rx), h); - if (this.rx.value > this.width.value / 2) { //rx属性が幅より大きければ、幅の半分を属性に設定 - this.rx.value = this.width.value / 2; - } - if (this.ry.value > this.height.value / 2) { - this.ry.value = this.height.value / 2; - } + this.x = new STLength((rect.getAttribute("x") || 0), w); + this.y = new STLength((rect.getAttribute("y") || 0), h); + this.width = new STLength(rect.getAttribute("svgwidth"), w); + this.height = new STLength(rect.getAttribute("svgheight"), h); + var rx = rect.getAttribute("rx"), ry = rect.getAttribute("ry"); + if (rx || ry) { + this.rx = new STLength((rx || ry), w); + this.ry = new STLength((ry || rx), h); + if (this.rx.value > this.width.value / 2) { //rx属性が幅より大きければ、幅の半分を属性に設定 + this.rx.value = this.width.value / 2; } - this.paint = new NAIBU.PaintColor(rect); - this.transformable = NAIBU.transformToCTM(rect,matrix); - w = h = rx = ry = null; - } catch(ee) {stlog.add(ee,545);} + if (this.ry.value > this.height.value / 2) { + this.ry.value = this.height.value / 2; + } + } + this.paint = new NAIBU.PaintColor(rect); + this.transformable = NAIBU.transformToCTM(rect,matrix); + w = h = rx = ry = null; return this; } STRectElement.prototype.set = function rectset(w,h) { @@ -979,8 +967,6 @@ var pl = new PList(list); var plm = pl.matrixTransform(ttm); var dat = plm.list.join(" "); - } catch(e) {stlog.add(e,564);} - try { var ele = this.tar; ele.path = dat; ele.coordsize = w + " " + h; @@ -1148,18 +1134,16 @@ } }; NAIBU.PaintColor.prototype.getAttribute = function( /*string*/ name) { - try { - var element = this.tar; - var style = element.style[name]; - if (style) { - name = null; - return style; - } - var attribute = element.attributes[name]; - var s = attribute ? attribute.nodeValue : null; + var element = this.tar; + var style = element.style[name]; + if (style) { name = null; - return s; - } catch(e) {stlog.add(e,659); return null;} + return style; + } + var attribute = element.attributes[name]; + var s = attribute ? attribute.nodeValue : null; + name = null; + return s; }; //内部プロパティを、styleに設定する NAIBU.PaintColor.prototype.setStyle = function() { @@ -1206,7 +1190,6 @@ el.stroked = "false"; } else { var strokeElement = document.createElement("v:stroke"); - try { var sw = new STLength(this.strokewidth, Math.sqrt((w*w + h*h) / 2)); var swx = sw.value * Math.sqrt(Math.abs(matrix.determinant())); strokeElement.setAttribute("weight", swx + "px"); @@ -1243,7 +1226,6 @@ strokeElement.setAttribute("dashstyle", this.strokedasharray); tsd = strs = null; } - } catch(e) {stlog.add(e,720); strokeElement.on = "false";} el.appendChild(strokeElement); sw = tsd = null; }