svnno****@sourc*****
svnno****@sourc*****
2009年 11月 25日 (水) 23:16:15 JST
Revision: 1435 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=1435 Author: dhrname Date: 2009-11-25 23:16:15 +0900 (Wed, 25 Nov 2009) Log Message: ----------- Modified Paths: -------------- branches/05x/055/sie.js Modified: branches/05x/055/sie.js =================================================================== --- branches/05x/055/sie.js 2009-11-24 13:15:07 UTC (rev 1434) +++ branches/05x/055/sie.js 2009-11-25 14:16:15 UTC (rev 1435) @@ -2162,56 +2162,77 @@ }; function STSetElement(/*Element*/ ele, /*Matrix*/ matrix, /*float*/w, h) { - var parent = ele.parentNode, pnodeName = parent.nodeName, ancestors = []; - try { - while (pnodeName === "group" || pnodeName === "A" || pnodeName === "DIV") { - parent = parent.parentNode; - pnodeName = parent.nodeName; - ancestors[ancestors.length] = parent; - } - for (var i=ancestors.length-1;i>=0--i) { - matrix = NAIBU.transformToCTM(ancestors[i], matrix); - } - } catch(e) {} + var parent = ele.parentNode, dummy = new Matrix(1, 0, 0, 1, 0, 0), s = {}; if (parent.nodeName === "shape") { switch (parent.getAttribute("tag")) { case "path": - s = new STPath(parent, matrix); + s = new STPath(parent, dummy); break; case "rect": - s = new STRectElement(parent, matrix, w, h); + s = new STRectElement(parent, dummy, w, h); break; case "circle": - s = new STCircle(parent, matrix, w, h); + s = new STCircle(parent, dummy, w, h); break; case "ellipse": - s = new STEllipse(parent, matrix, w, h); + s = new STEllipse(parent, dummy, w, h); break; case "polyline": - s = new STPolyline(parent, matrix); + s = new STPolyline(parent, dummy); break; case "polygon": - s = new STPolygon(parent, matrix); + s = new STPolygon(parent, dummy); break; case "line": - s = new STLine(parent, matrix, w, h); - break; - } - } else if (parent.nodeName === "DIV") { - s = new STText(parent, matrix, w, h); - } else if (parent.nodeName === "group") { - s = new STGroupElement(parent, matrix, w, h); - } else if (parent.nodeName === "A") { - s = new STAElement(parent, matrix); - } else if (parent.nodeName === "image") { - s = new STImage(parent, matrix, w, h); - } + s = new STLine(parent, dummy, w, h); + break; + } + } else if (parent.nodeName === "DIV") { + s = new STText(parent, dummy, w, h); + } else if (parent.nodeName === "group") { + s = new STGroupElement(parent, dummy, w, h); + } else if (parent.nodeName === "A") { + s = new STAElement(parent, dummy); + } else if (parent.nodeName === "image") { + s = new STImage(parent, dummy, w, h); + } + s.transformable = matrix; this.target = s; this.transformable = matrix; + this.currentTime = 0; + this._begin = this._end = this._active = null; + dummy = null; return this; }; STSetElement.prototype.set = function (w,h){ }; +//sはフレーム数であることに気をつけること +STSetElement.prototype._frame = function (/*int*/ s){ + if (this._begin && this._end) { + if (this._begin >= s && this.currentTime === 0) { + this.beginElement(); + this.currentTime++; + } + if (this._end >= s && this.currentTime !== 0) { + this.endElement(); + this.currentTime = 0; + this._begin = null; + } + } +}; +};STSetElement.prototype.beginElement = function (){ + var target = this.target; +}; +STSetElement.prototype.endElement = function (){ + var target = this.target; +}; +STSetElement.prototype.beginElementAt = function (offset){ + this._begin = offset * 0.8 * 0.024; //フレーム数に変換(軽量化のために、1s = 800msで計算) +}; +STSetElement.prototype.endElementAt = function (offset){ + this._end = offset * 0.8 * 0.024; +}; + function utf16( /*string*/ s) { return unescape(s); }