mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
Photomerge: reach the snapshots through DocState's accessors on main
This commit is contained in:
1 parent
424cc8c547
commit
b2006754bc
2 files changed
+6
-3
No files matched your search
@@ -1061,7 +1061,10 @@ fn open_photomerge_result(s: &mut Session, doc: Document, unblended: Option<Docu
|
||||
st.history.set_current_label(label);
|
||||
// The first snapshot (History Options › Automatically Create First Snapshot) is the
|
||||
// document before the step; without it the state before the step is not kept.
|
||||
if let (Some(d), Some(first)) = (unblended, st.snapshots.first_mut().filter(|snap| snap.id == 0)) {
|
||||
if let Some(d) = unblended
|
||||
&& st.snapshots().first().is_some_and(|snap| snap.id == 0)
|
||||
&& let Some(first) = st.snapshots_mut().first_mut()
|
||||
{
|
||||
first.doc = std::sync::Arc::new(d);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,8 +78,8 @@ fn blend_on_is_one_auto_blend_layers_step_targeting_every_source() {
|
||||
let st = s.active().unwrap();
|
||||
assert_eq!(st.active_layer, st.doc.top_layer(), "{layout}: the top layer stays the key layer");
|
||||
// The first snapshot stays, named after the document.
|
||||
assert_eq!(st.snapshots.len(), 1, "{layout}");
|
||||
assert_eq!(st.snapshots[0].name, st.doc.name, "{layout}");
|
||||
assert_eq!(st.snapshots().len(), 1, "{layout}");
|
||||
assert_eq!(st.snapshots()[0].name, st.doc.name, "{layout}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user