Populate layer entry cache (#437)

* Populate layer entry cache

* Serialize the DocumentMessageHandler

* Fix restoring of collapsed/expanded state, add iter impl for Layer, and clean up layer_data() functions

* Fixed bug with CreateEmptyLayer revealed by test

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: otdavies <oliver@psyfer.io>
This commit is contained in:
0HyperCube
2021-12-29 04:32:44 +00:00
committed by Keavon Chambers
co-authored by Keavon Chambers otdavies
parent 3eb915eaee
commit fd1ddfc41e
10 changed files with 156 additions and 83 deletions
-4
View File
@@ -35,10 +35,6 @@ impl LayerData {
}
}
pub fn layer_data<'a>(layer_data: &'a mut HashMap<Vec<LayerId>, LayerData>, path: &[LayerId]) -> &'a mut LayerData {
layer_data.get_mut(path).expect(&format!("Layer data cannot be found because the path {:?} does not exist", path))
}
pub fn layer_panel_entry(layer_data: &LayerData, transform: DAffine2, layer: &Layer, path: Vec<LayerId>) -> LayerPanelEntry {
let layer_type: LayerType = (&layer.data).into();
let name = layer.name.clone().unwrap_or_else(|| format!("Unnamed {}", layer_type));