Skip to content

Commit

Permalink
feat(layout): add Bbox implementation for PortGeometry (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanku authored Feb 25, 2024
1 parent a47d55c commit e295119
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions substrate/src/io/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ impl PortGeometry {
}
}

impl Bbox for PortGeometry {
fn bbox(&self) -> Option<Rect> {
self.shapes().fold(None, |a, b| a.bounding_union(&b.bbox()))
}
}

/// A type that can is a bundle of layout ports.
///
/// An instance of a [`HardwareType`].
Expand Down

0 comments on commit e295119

Please sign in to comment.