ブラウザでSVGを表示するSIEの開発 (SIE - to display SVG on legacy browsers)
| リビジョン | fbece7487936a5c6941bb37cfacabb79fed2b840 (tree) |
|---|---|
| 日時 | 2015-08-31 22:54:55 |
| 作者 | dhrname <dhrname@user...> |
| コミッター | dhrname |
Support an eventOffset property
| @@ -208,7 +208,7 @@ base("$frame").mix ( { | ||
| 208 | 208 | /*現在のフレーム数を改めて初期化*/ |
| 209 | 209 | currentFrame: 0, |
| 210 | 210 | |
| 211 | - /*イベント同期で使う時間差*/ | |
| 211 | + /*イベント同期で使う時間差のフレーム数*/ | |
| 212 | 212 | eventOffset: 0, |
| 213 | 213 | |
| 214 | 214 | /*trim メソッド |
| @@ -316,7 +316,7 @@ base("$frame").mix ( { | ||
| 316 | 316 | throw new Error(); |
| 317 | 317 | } |
| 318 | 318 | /*イベントのリスナーが遅かった場合の、誤差の演算をしておく*/ |
| 319 | - this.begin += this.$frame.currentFrame - Math.floor( (Date.now() - evt.timeStamp) * this.fpms ); | |
| 319 | + this.begin = this.eventOffset + this.$frame.currentFrame - Math.floor( (Date.now() - evt.timeStamp) * this.fpms ); | |
| 320 | 320 | var s = this.$activate; |
| 321 | 321 | s.begin = this.begin; |
| 322 | 322 | this.activeTime = s.call(); |
| @@ -452,7 +452,7 @@ base("$frame").mix ( { | ||
| 452 | 452 | /*強制的に終了させる*/ |
| 453 | 453 | this.$frame.removeLine(this.$begin); |
| 454 | 454 | } |
| 455 | - this.begin += this.$frame.currentFrame - Math.floor( (Date.now() - evt.timeStamp) * this.fpms ); | |
| 455 | + this.begin = this.eventOffset + this.$frame.currentFrame - Math.floor( (Date.now() - evt.timeStamp) * this.fpms ); | |
| 456 | 456 | var s = this.$begin.$activate; |
| 457 | 457 | s.end = this.begin; |
| 458 | 458 | this.$begin.activeTime = s.call(); |
| @@ -1030,7 +1030,7 @@ base("$calcMode").up("$attribute").mix( { | ||
| 1030 | 1030 | ); |
| 1031 | 1031 | /*activeTimeとbeginとsimpleDurプロパティは_setEndFrame関数内で使うため、コピーしておく*/ |
| 1032 | 1032 | this.activeTime = line.activeTime; |
| 1033 | - this.begin = line.begin; | |
| 1033 | + this.begin = this.eventOffset = line.begin; | |
| 1034 | 1034 | this.simpleDuration = line.simpleDuration; |
| 1035 | 1035 | base("$frame").addLine( |
| 1036 | 1036 | { setFrame: this._setEndFrame.bind(this), |
| @@ -2454,6 +2454,7 @@ describe("SMIL Animation Spec", function() { | ||
| 2454 | 2454 | |
| 2455 | 2455 | obj.up().mix( { |
| 2456 | 2456 | begin: 1, |
| 2457 | + eventOffset: 1, | |
| 2457 | 2458 | $activate: begin.$activate.up().mix( { |
| 2458 | 2459 | dur: "12" |
| 2459 | 2460 | } ) |
| @@ -2470,6 +2471,7 @@ describe("SMIL Animation Spec", function() { | ||
| 2470 | 2471 | it("should be this for the value (the valid partion)", function() { |
| 2471 | 2472 | obj.up().mix( { |
| 2472 | 2473 | begin: 1, |
| 2474 | + eventOffset: 1, | |
| 2473 | 2475 | $activate: begin.$activate.up().mix( { |
| 2474 | 2476 | end: begin.$activate.end.up().mix( { |
| 2475 | 2477 | string: "1s" |
| @@ -2486,6 +2488,7 @@ describe("SMIL Animation Spec", function() { | ||
| 2486 | 2488 | |
| 2487 | 2489 | obj.up().mix( { |
| 2488 | 2490 | begin: 1, |
| 2491 | + eventOffset: 1, | |
| 2489 | 2492 | $activate: begin.$activate.up().mix( { |
| 2490 | 2493 | end: begin.$activate.end.up().mix( { |
| 2491 | 2494 | string: "1s" |