mirror of
https://github.com/motion-canvas/motion-canvas.git
synced 2026-01-12 07:18:01 -05:00
fix: previous scene invisible when seeking
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user