if (!evt.timeStamp && (evt.timeStamp !== 0)) {\r
throw new Error();\r
}\r
- /*イベントのリスナーが遅かった場合の、誤差の演算をしておく*/\r
- this.begin = this.eventOffset + this.$frame.currentFrame - Math.floor( (Date.now() - evt.timeStamp) * this.fpms );\r
+ this.begin = this.eventOffset + this.$frame.currentFrame;\r
var s = this.$activate;\r
s.begin = this.begin;\r
this.activeTime = s.call() || Number.MAX_VALUE;\r
/*強制的に終了させる*/\r
this.removeLine(this.$begin);\r
}\r
- this.begin = this.eventOffset + this.$frame.currentFrame - Math.floor( (Date.now() - evt.timeStamp) * this.fpms );\r
+ this.begin = this.eventOffset + this.$frame.currentFrame;\r
var s = this.$begin.$activate;\r
s.end = this.begin;\r
/*未解決だったendの値が、イベントの発生により、解決して再定義されたとき、\r
obj.$1.listener( {\r
timeStamp: (Date.now() + 500)\r
} );\r
- expect(obj.$1.begin).toBe(Math.floor(500*obj.fpms) + 1);\r
- expect(obj.$1.activeTime).toBe(Math.floor(1000*obj.fpms) - Math.floor(500*obj.fpms) - 1);\r
+ expect(obj.$1.begin).toBe(1);\r
+ expect(obj.$1.activeTime).toBe(Math.floor(1000*obj.fpms) - 1);\r
expect(obj.$1.$activate.begin).toBe(obj.$1.begin);\r
expect(obj.timelines[1]).toBe(obj.$1);\r
} );\r
timeStamp: (Date.now() + 120)\r
} );\r
expect(obj.timelines[0]).not.toBe(obj.$begin);\r
- expect(obj.begin).toBe(Math.ceil(120*obj.fpms));\r
- expect(obj.$begin.activeTime).toBe(Math.ceil(120*obj.fpms));\r
+ expect(obj.begin).toBe(0);\r
+ expect(obj.$begin.activeTime).toBe(0);\r
\r
obj.addLine(obj.$begin.mix( {\r
begin: 12,\r
timeStamp: (Date.now() + 12)\r
} );\r
expect(obj.timelines[0]).toBe(obj.$begin);\r
- expect(obj.begin).toBe(Math.ceil(1012*obj.fpms));\r
- expect(obj.$begin.activeTime).toBe(Math.ceil(1012*obj.fpms));\r
+ expect(obj.begin).toBe(Math.ceil(1000*obj.fpms));\r
+ expect(obj.$begin.activeTime).toBe(Math.ceil(1000*obj.fpms));\r
} );\r
/*無効同値クラスを調べておく (Equivalence partitioning, the following is the invalid partion)*/\r
it("should be this for the value (the invalid partion)", function() {\r
expect($animate.isEnd).toBeFalsy();\r
expect($animate.state).toBe("idling");\r
p.dispatchEvent(evt);\r
+ frame.setFrame(frame.currentFrame + 1);\r
+ expect($animate.state).toBe("playing");\r
frame.setFrame(frame.currentFrame + 24);\r
expect($animate.state).toBe("idling");\r
expect(evt.target.getAttributeNS(null, "fill") || null).toBe("rgb(10, 10, 1)");\r