We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ded4b13 commit ace4438Copy full SHA for ace4438
crates/usvg/src/tree/mod.rs
@@ -1573,6 +1573,15 @@ impl Tree {
1573
self.size
1574
}
1575
1576
+ /// Returns the actual size of the image, accounting for strokes, filters
1577
+ /// and transforms.
1578
+ ///
1579
+ /// May exceed the original [`size`](Tree::size).
1580
+ pub fn max_size(&self) -> Size {
1581
+ let bbox = self.root().abs_layer_bounding_box();
1582
+ Size::from_wh(bbox.width(), bbox.height()).unwrap_or(self.size)
1583
+ }
1584
+
1585
/// The root element of the SVG tree.
1586
pub fn root(&self) -> &Group {
1587
&self.root
0 commit comments