Implement artboards and document version enforcement (#466)

* - graphite document artboard implementation
- autosave document load hitch fix
- Autosave will delete saved files when graphite document version changes

* formating

* - top left 0,0
- fixed hitch on first document
- vue calls first render

* Revert

* Merge branch 'master' into artboards

* Small bug fixes and code review tweaks

Co-authored-by: Oliver Davies <oliver@psyfer.io>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
mfish33
2022-01-08 07:50:08 -08:00
committed by Keavon Chambers
co-authored by Oliver Davies Keavon Chambers
parent 8fedfb603e
commit effc8354d1
17 changed files with 218 additions and 33 deletions
-3
View File
@@ -1,8 +1,5 @@
use crate::color::Color;
// Document
pub const GRAPHENE_DOCUMENT_VERSION: &str = "0.0.1";
// RENDERING
pub const LAYER_OUTLINE_STROKE_COLOR: Color = Color::BLACK;
pub const LAYER_OUTLINE_STROKE_WIDTH: f32 = 1.;
-3
View File
@@ -1,4 +1,3 @@
use crate::consts::GRAPHENE_DOCUMENT_VERSION;
use std::{
cmp::max,
collections::hash_map::DefaultHasher,
@@ -20,7 +19,6 @@ pub struct Document {
/// This identifier is not a hash and is not guaranteed to be equal for equivalent documents.
#[serde(skip)]
pub state_identifier: DefaultHasher,
pub graphene_document_version: String,
}
impl Default for Document {
@@ -28,7 +26,6 @@ impl Default for Document {
Self {
root: Layer::new(LayerDataType::Folder(Folder::default()), DAffine2::IDENTITY.to_cols_array()),
state_identifier: DefaultHasher::new(),
graphene_document_version: GRAPHENE_DOCUMENT_VERSION.to_string(),
}
}
}