Add responses in document for layer system (#91)

This commit is contained in:
TrueDoctor
2021-05-02 00:57:47 +02:00
committed by Keavon Chambers
parent b27eaf3fae
commit f05cb30acb
22 changed files with 219 additions and 64 deletions

View File

@@ -47,6 +47,10 @@ impl Folder {
self.layer_ids.as_slice()
}
pub fn layers(&self) -> &[Layer] {
self.layers.as_slice()
}
pub fn layer(&self, id: LayerId) -> Option<&Layer> {
let pos = self.layer_ids.iter().position(|x| *x == id)?;
Some(&self.layers[pos])