From cb26c7b0573b2556636add4582c8e40696470a60 Mon Sep 17 00:00:00 2001 From: christopher-besch Date: Sat, 20 Nov 2021 20:04:17 +0100 Subject: [PATCH] fixed wrong order --- manim_editor/editor/create_project.py | 6 ++++-- web_src/ts/presenter/presentation.ts | 9 ++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/manim_editor/editor/create_project.py b/manim_editor/editor/create_project.py index db2f675c..c89cbbf7 100644 --- a/manim_editor/editor/create_project.py +++ b/manim_editor/editor/create_project.py @@ -5,7 +5,7 @@ from typing import List, Tuple from .manim_loader import get_scenes -from .presentation_classes import Section, Slide +from .presentation_classes import Scene, Section, Slide __all__ = ["create_project_dir", "populate_project_with_loaded_sections", "populate_project"] @@ -64,7 +64,9 @@ def populate_project(project_name: str, scene_ids: List[int]) -> bool: """ print(f"Populating project '{project_name}'.") # select scenes according to ids set by frontend - scenes = [scene for scene in get_scenes() if scene.id in scene_ids] + scenes_raw = get_scenes() + scenes = [scenes_raw[scene_id] for scene_id in scene_ids] + sections: List[Section] = [] for scene in scenes: sections += scene.sections diff --git a/web_src/ts/presenter/presentation.ts b/web_src/ts/presenter/presentation.ts index 75a85015..e904f82c 100644 --- a/web_src/ts/presenter/presentation.ts +++ b/web_src/ts/presenter/presentation.ts @@ -95,10 +95,7 @@ export abstract class Presentation { case SectionType.SKIP: next_element.onended = (_) => { // immediately go to next section without user input - ++this.current_section; - this.next_section = this.current_section; - this.set_time_stamp(); - this.update_video(); + this.play_section(this.current_section + 1, true); } break; case SectionType.LOOP: @@ -112,9 +109,7 @@ export abstract class Presentation { next_element.onended = (_) => { // when next section has changed, go to next one // otherwise restart - this.current_section = this.next_section; - this.set_time_stamp(); - this.update_video(); + this.play_section(this.next_section, true); } break; // SectionType.NORMAL