Compare commits
2 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
32740f3b22 | |
|
|
6a2460c42f |
|
|
@ -26,7 +26,6 @@ features = ["v2_56"]
|
|||
version = "0.13.2"
|
||||
features = ["v3_22"]
|
||||
|
||||
|
||||
[patch.crates-io]
|
||||
druid = { git = "https://github.com/doppioandante/druid", branch = "v0.7.0_stiletto", features = ["im", "svg"] }
|
||||
#druid = { path = "../druid/druid/", features = ["im", "svg"] }
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ impl Serialize for Path {
|
|||
PathEl::MoveTo(pt) => Some(Into::<(f64, f64)>::into(pt)),
|
||||
PathEl::LineTo(pt) => Some(Into::<(f64, f64)>::into(pt)),
|
||||
_ => None,
|
||||
}))
|
||||
}).collect::<Vec<(f64, f64)>>())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ pub mod commands {
|
|||
}
|
||||
|
||||
pub const STILETTO_FORMAT_MAJOR: u16 = 0;
|
||||
pub const STILETTO_FORMAT_MINOR: u16 = 1;
|
||||
pub const STILETTO_FORMAT_MINOR: u16 = 2;
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DocumentSnapshot {
|
||||
|
|
@ -42,7 +42,7 @@ pub struct DocumentSnapshot {
|
|||
}
|
||||
|
||||
impl DocumentSnapshot {
|
||||
pub fn to_writer<W: std::io::Write>(&self, writer: W) -> Result<(), serde_json::Error> {
|
||||
serde_json::to_writer_pretty(writer, &self)
|
||||
pub fn to_writer<W: std::io::Write>(&self, writer: W) -> Result<(), serde_bare::Error> {
|
||||
serde_bare::to_writer(writer, &self)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -274,8 +274,8 @@ impl AppDelegate<StilettoState> for Delegate {
|
|||
}
|
||||
if let Some(file_info) = cmd.get(commands::OPEN_FILE) {
|
||||
if let Ok(f) = File::open(file_info.path()) {
|
||||
let res_snapshot: Result<DocumentSnapshot, serde_json::Error> =
|
||||
serde_json::from_reader(f);
|
||||
let res_snapshot: Result<DocumentSnapshot, serde_bare::Error> =
|
||||
serde_bare::from_reader(f);
|
||||
if let Ok(document_snapshot) = res_snapshot {
|
||||
data.canvas.set_from_snapshot(document_snapshot);
|
||||
data.current_file_path = Some(file_info.path().to_path_buf());
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ impl StilettoDocument {
|
|||
|
||||
pub fn migrate_to_next(self) -> StilettoDocument {
|
||||
match self {
|
||||
StilettoDocument::DocumentSnapshot0_1(_) => self,
|
||||
StilettoDocument::DocumentSnapshot0_1(snapshot) => StilettoDocument::DocumentSnapshot0_2(snapshot) ,
|
||||
StilettoDocument::DocumentSnapshot0_2(_) => self,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue