svnno****@sourc*****
svnno****@sourc*****
2009年 11月 25日 (水) 23:57:00 JST
Revision: 1436
http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=1436
Author: dhrname
Date: 2009-11-25 23:57:00 +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-25 14:16:15 UTC (rev 1435)
+++ branches/05x/055/sie.js 2009-11-25 14:57:00 UTC (rev 1436)
@@ -2198,33 +2198,65 @@
}
s.transformable = matrix;
this.target = s;
+ this.tar = ele;
this.transformable = matrix;
- this.currentTime = 0;
- this._begin = this._end = this._active = null;
+ this.currentFrame = 0;
+ this.attributeName = ele.getAttribute("attributeName").replace(/(fill|stroke)\-/, "&1");
+ this.begin = ele.getAttribute("begin");
+ this.end = ele.getAttribute("end");
+ this.dur = ele.getAttribute("dur");
+ this.fill = ele.getAttribute("fill");
+ this.w = w;
+ this.h = h;
+ this._begin = this._end = null;
dummy = null;
return this;
};
STSetElement.prototype.set = function (w,h){
+ this.to = this.tar.getAttribute("to");
};
//sはフレーム数であることに気をつけること
STSetElement.prototype._frame = function (/*int*/ s){
if (this._begin && this._end) {
- if (this._begin >= s && this.currentTime === 0) {
+ if (this._begin >= s && this.currentFrame === 0) {
this.beginElement();
- this.currentTime++;
+ this.currentFrame++;
}
- if (this._end >= s && this.currentTime !== 0) {
+ if (this._end >= s && this.currentFrame !== 0) {
this.endElement();
- this.currentTime = 0;
+ this.currentFrame = 0;
this._begin = null;
}
}
};
};STSetElement.prototype.beginElement = function (){
var target = this.target;
+ var base = target[this.attributeName];
+ if (base !== void 0) {
+ if (typeof base === "string") {
+ target[this.attributeName] = this.to;
+ } else if (base instanceOf STLength) {
+ var s = base.value;
+ base.newValueSpecified(base.unitType, parseFloat(this.to));
+ base = s;
+ }
+ } else if (target.paint.defaults[this.attributeName] !== void 0) {
+ base = target.paint[this.attributeName];
+ target.paint[this.attributeName] = this.to;
+ } else {
+ base = "";
+ }
+ target.set(this.w, this.h);
+ this.base = base;
};
STSetElement.prototype.endElement = function (){
- var target = this.target;
+ if (this.fill) {
+ if (this.fill === "freeze") {
+ return;
+ }
+ }
+ this.to = this.base;
+ this.beginElement();
};
STSetElement.prototype.beginElementAt = function (offset){
this._begin = offset * 0.8 * 0.024; //フレーム数に変換(軽量化のために、1s = 800msで計算)