Add file format version
This commit is contained in:
parent
56ed3b7c01
commit
57ef9e5e0e
|
|
@ -30,5 +30,7 @@ pub mod commands {
|
|||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DocumentSnapshot {
|
||||
pub format_version_major: u16,
|
||||
pub format_version_minor: u16,
|
||||
pub canvas_elements: Vec<canvas::CanvasElement>,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ impl AppDelegate<StilettoState> for Delegate {
|
|||
data.canvas.set_from_snapshot(document_snapshot);
|
||||
info!("Loaded file {}", file_info.path().display());
|
||||
} else {
|
||||
warn!("didn't work: {:?}", res_snapshot.err());
|
||||
warn!("Error while loading {}: {:?}", file_info.path().display(), res_snapshot.err());
|
||||
}
|
||||
}
|
||||
return Handled::Yes;
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ impl CanvasState {
|
|||
|
||||
pub fn get_document_snapshot(&self) -> DocumentSnapshot {
|
||||
DocumentSnapshot {
|
||||
format_version_major: 0,
|
||||
format_version_minor: 1,
|
||||
canvas_elements: self
|
||||
.versioned_canvas
|
||||
.get()
|
||||
|
|
|
|||
Loading…
Reference in New Issue