Skip to content
Snippets Groups Projects
Commit 7a838d13 authored by David Sehnal's avatar David Sehnal
Browse files

mol-plugin: animation tweaks

parent 81c96168
Branches
Tags
No related merge requests found
......@@ -44,6 +44,7 @@ class PluginState {
getSnapshot(params?: PluginState.GetSnapshotParams): PluginState.Snapshot {
const p = { ...PluginState.DefaultGetSnapshotParams, ...params };
console.log(p.animation, this.animation.getSnapshot());
return {
id: UUID.create22(),
data: p.data ? this.dataState.getSnapshot() : void 0,
......
......@@ -176,9 +176,16 @@ class PluginAnimationManager extends PluginComponent<PluginAnimationManager.Stat
}
}
private resume() {
private async resume() {
this._current.lastTime = 0;
this._current.startedTime = -1;
const anim = this._current.anim;
if (!this.context.behaviors.state.isAnimating.value) {
this.context.behaviors.state.isAnimating.next(true);
}
if (anim.setup) {
await anim.setup(this._current.paramValues, this.context);
}
requestAnimationFrame(this.animate);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment