diff --git a/CHANGELOG.md b/CHANGELOG.md index 88a9fe6e3..f7d560296 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/). This changelog also contains important changes in dependencies. ## [Unreleased] +### Added +- `usvg::Group::abs_bounding_box` +- `usvg::Group::abs_stroke_bounding_box` +- `usvg::Path::abs_bounding_box` +- `usvg::Path::abs_stroke_bounding_box` +- `usvg::Text::abs_bounding_box` +- `usvg::Text::abs_stroke_bounding_box` + +### Removed +- `usvg::Group::abs_bounding_box()` method. It's a field now. +- `usvg::Group::abs_filters_bounding_box()` + ### Fixed - `font-family` parsing. - Absolute bounding box calculation for paths. diff --git a/crates/c-api/lib.rs b/crates/c-api/lib.rs index 58813bc92..440bcb07a 100644 --- a/crates/c-api/lib.rs +++ b/crates/c-api/lib.rs @@ -681,7 +681,7 @@ pub extern "C" fn resvg_get_image_bbox( if let Some(r) = tree .0 .root - .abs_bounding_box() + .abs_bounding_box .and_then(|r| r.to_non_zero_rect()) { unsafe { diff --git a/crates/usvg-tree/src/lib.rs b/crates/usvg-tree/src/lib.rs index 8a5e5ba45..24d878fce 100644 --- a/crates/usvg-tree/src/lib.rs +++ b/crates/usvg-tree/src/lib.rs @@ -1007,11 +1007,6 @@ impl Group { !self.children.is_empty() } - /// Returns node's bounding box in canvas coordinates. - pub fn abs_bounding_box(&self) -> Option { - self.bounding_box?.transform(self.abs_transform) - } - /// Calculates a node's filter bounding box. /// /// Filters with `objectBoundingBox` and missing or zero `bounding_box` would be ignored. @@ -1044,11 +1039,6 @@ impl Group { full_region.to_non_zero_rect() } - /// Calculates a node's filter bounding box in canvas coordinates. - pub fn abs_filters_bounding_box(&self) -> Option { - self.filters_bounding_box()?.transform(self.abs_transform) - } - fn subroots(&self, f: &mut dyn FnMut(&Group)) { if let Some(ref clip) = self.clip_path { f(&clip.borrow().root);