Make the show/hide layer buttons work (#118) (#127)

This commit is contained in:
akshay1992kalbhor
2021-05-18 18:55:05 +02:00
committed by GitHub
parent 81effa550f
commit b23fa6d84f
3 changed files with 16 additions and 1 deletions
+8
View File
@@ -300,6 +300,14 @@ impl Document {
let children = self.layer_panel(path.as_slice())?;
Some(vec![DocumentResponse::DocumentChanged, DocumentResponse::ExpandFolder { path, children }])
}
Operation::ToggleVisibility { path } => {
let _ = self.layer_mut(&path).map(|layer| {
layer.visible = !layer.visible;
layer.cache_dirty = true;
});
let children = self.layer_panel(&path.as_slice()[..path.len() - 1])?;
Some(vec![DocumentResponse::ExpandFolder { path: vec![], children }])
}
};
Ok(responses)
}
+3
View File
@@ -68,4 +68,7 @@ pub enum Operation {
DiscardWorkingFolder,
ClearWorkingFolder,
CommitTransaction,
ToggleVisibility {
path: Vec<LayerId>,
},
}