Known cases of crash / incorrect behavior resolved

This commit is contained in:
otdavies
2022-01-02 18:30:40 -08:00
parent 763a1c5a5d
commit 3dee234670
4 changed files with 36 additions and 17 deletions
+1 -2
View File
@@ -95,7 +95,7 @@ impl Document {
self.folder_mut(path)?.layer_mut(id).ok_or_else(|| DocumentError::LayerNotFound(path.into()))
}
pub fn deepest_common_folder<'a>(&self, layers: impl Iterator<Item = &'a [LayerId]>) -> Result<&'a [LayerId], DocumentError> {
pub fn shallowest_common_folder<'a>(&self, layers: impl Iterator<Item = &'a [LayerId]>) -> Result<&'a [LayerId], DocumentError> {
let common_prefix_of_path = self.common_layer_path_prefix(layers);
Ok(match self.layer(common_prefix_of_path)?.data {
@@ -546,7 +546,6 @@ impl Document {
Some(vec![LayerChanged { path: path.clone() }])
}
Operation::CreateFolder { path } => {
log::debug!("Creating a folder with path {:?}", path);
self.set_layer(path, Layer::new(LayerDataType::Folder(Folder::default()), DAffine2::IDENTITY.to_cols_array()), -1)?;
self.mark_as_dirty(path)?;
-1
View File
@@ -102,7 +102,6 @@ impl Folder {
}
pub fn folder_contains(&self, id: LayerId) -> bool {
log::debug!("For {:?} Folder does contain {:?}", id, self.layer_ids.contains(&id));
self.layer_ids.contains(&id)
}