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