mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-20 21:06:09 +08:00
Add support for folder bounding boxes (#276)
This commit is contained in:
committed by
Keavon Chambers
parent
59b817301d
commit
783b7801e6
@@ -175,8 +175,12 @@ impl Layer {
|
||||
self.data.to_kurbo_path(self.transform, self.style)
|
||||
}
|
||||
|
||||
pub fn bounding_box(&self, transform: glam::DAffine2, style: style::PathStyle) -> [DVec2; 2] {
|
||||
self.data.bounding_box(transform, 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)
|
||||
} else {
|
||||
Some(self.data.bounding_box(transform, style))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn as_folder_mut(&mut self) -> Result<&mut Folder, DocumentError> {
|
||||
|
||||
Reference in New Issue
Block a user