base("$frame").up("$svgEvent").mix( {\r
log: [],\r
setFrame: function(num) {\r
- if (this.timelines.length > 0) {\r
- this.log.push( {\r
- frame: 0,\r
- target: this.timelines[0].target\r
- } );\r
+ for (var i=0;i<this.log.length;++i) {\r
+ /*ログを検索して、過去にイベントを実行したものは除外する*/\r
+ if (this.log[i].frame <= num) {\r
+ return this.$frame.setFrame(num);\r
+ }\r
+ }\r
+ for (var i=0;i<this.timelines.length;++i) {\r
+ var timeline = this.timelines[i];\r
+ if (timeline.begin <= num) {\r
+ /*beginEventを発動させる*/\r
+ this.log.push( {\r
+ frame: num,\r
+ target: timeline.target\r
+ } );\r
+ }\r
}\r
return this.$frame.setFrame(num);\r
}\r
target: ele\r
}\r
]);\r
+ frame.setFrame(0);\r
+ expect(frame.log).toEqual([\r
+ { frame: 0,\r
+ target: ele\r
+ }\r
+ ]);\r
+ \r
+ frame.setFrame(1);\r
+ expect(frame.log).toEqual([\r
+ { frame: 0,\r
+ target: ele\r
+ }\r
+ ]);\r
+ frame.setFrame(1);\r
+ expect(frame.log).toEqual([\r
+ { frame: 0,\r
+ target: ele\r
+ }\r
+ ]);\r
} );\r
/*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/\r
it("should be this for the value (the valid partion )", function() {\r