fix: previous scene invisible when seeking

This commit is contained in:
aarthificial
2022-04-06 01:58:37 +02:00
parent 3242c68770
commit 65e32f03b7
2 changed files with 1 additions and 4 deletions

View File

@@ -97,7 +97,6 @@ export class Project extends Stage {
await this.currentScene.next();
if (this.currentScene.canTransitionOut()) {
this.previousScene = this.currentScene;
this.previousScene.transitionFrame = this.frame;
this.currentScene = this.getNextScene(this.previousScene);
if (this.currentScene) {
await this.currentScene.reset(this.previousScene);
@@ -148,7 +147,7 @@ export class Project extends Stage {
private findBestScene(frame: number): Scene {
let lastScene = null;
for (const scene of Object.values(this.sceneLookup)) {
if (scene.transitionFrame === null || scene.transitionFrame > frame) {
if (scene.lastFrame === null || scene.lastFrame > frame) {
return scene;
}
lastScene = scene;

View File

@@ -27,7 +27,6 @@ export enum SceneState {
export class Scene extends Layer {
public firstFrame: number = null;
public transitionFrame: number = null;
public lastFrame: number = null;
public threadsCallback: ThreadsCallback = null;
@@ -53,7 +52,6 @@ export class Scene extends Layer {
public reload(runnerFactory: SceneRunner) {
this.runnerFactory = runnerFactory;
this.transitionFrame = null;
this.lastFrame = null;
}