mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-17 15:28:04 +08:00
@@ -74,6 +74,10 @@ impl Folder {
|
||||
self.layers.as_slice()
|
||||
}
|
||||
|
||||
pub fn layers_mut(&mut self) -> &mut [Layer] {
|
||||
self.layers.as_mut_slice()
|
||||
}
|
||||
|
||||
pub fn layer(&self, id: LayerId) -> Option<&Layer> {
|
||||
let pos = self.layer_ids.iter().position(|x| *x == id)?;
|
||||
Some(&self.layers[pos])
|
||||
|
||||
@@ -175,6 +175,10 @@ impl Layer {
|
||||
self.data.to_kurbo_path(self.transform, self.style)
|
||||
}
|
||||
|
||||
pub fn current_bounding_box(&self) -> Option<[DVec2; 2]> {
|
||||
self.bounding_box(self.transform, self.style)
|
||||
}
|
||||
|
||||
pub fn bounding_box(&self, transform: glam::DAffine2, style: style::PathStyle) -> Option<[DVec2; 2]> {
|
||||
if let Ok(folder) = self.as_folder() {
|
||||
folder.bounding_box(transform)
|
||||
|
||||
Reference in New Issue
Block a user