EffectCraft: An open-source motion graphics and compositing tool written by scratch in pure Rust
#1714: doc comments name the saved current times
arnav-hiwarkarea67c468809f
diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rsindex 3086f3780..d6c484d9c 100644--- a/crates/engine/src/lib.rs+++ b/crates/engine/src/lib.rs@@ -984,16 +984,17 @@ impl Session {self.events.push(Event::OpenComp(id));}- /// The open compositions, as a project file records them ([`effectcraft_project::SavedView`]).+ /// The open compositions and their current times, as a project file records them+ /// ([`effectcraft_project::SavedView`]).pub fn saved_view(&self) -> effectcraft_project::SavedView {let comp_times = self.state.times.iter().filter(|(id, _)| self.project.comp(**id).is_some()).map(|(id, t)| (*id, *t)).collect();effectcraft_project::SavedView { active_comp: self.state.active_comp, open_comps: self.state.open_comps.clone(), comp_times }}/// Reopen the compositions a project file was saved with (#748), each at its saved current- /// time (#1714). Ids that no longer name a- /// comp are skipped; with none left the project stays on the comp [`Session::replace_project`]- /// opened (its first), as files from before the view was saved do.+ /// time (#1714). Ids that no longer name a comp are skipped; with none left the project stays+ /// on the comp [`Session::replace_project`] opened (its first), as files from before the view+ /// was saved do.pub fn restore_view(&mut self, view: &effectcraft_project::SavedView) {for (id, t) in &view.comp_times {if let Some(comp) = self.project.comp(*id) {diff --git a/crates/project/src/lib.rs b/crates/project/src/lib.rsindex be35590ad..a4bffbe0c 100644--- a/crates/project/src/lib.rs+++ b/crates/project/src/lib.rs@@ -49,8 +49,9 @@ pub fn saved_by(text: &str) -> Option<String> {serde_json::from_str::<Meta>(text).ok()?.saved_by}-/// The compositions that were open when a project file was saved (`activeComp` and `openComps`-/// next to `savedBy`), so it reopens where it was left (#748). Editor state rather than project+/// The compositions that were open when a project file was saved and their current times+/// (`activeComp`, `openComps` and `compTimes` next to `savedBy`), so it reopens where it was left+/// (#748, #1714). Editor state rather than project/// content: opening a comp doesn't make the project unsaved, and it isn't part of/// [`Project`]. Older files have none; older versions ignore it.#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize)]