[librsvg: 27/30] bbox: cleanup
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 27/30] bbox: cleanup
- Date: Mon, 28 Dec 2020 20:06:30 +0000 (UTC)
commit f99a0c74b25369db1944e854f72a6ea872a40acc
Author: Paolo Borelli <pborelli gnome org>
Date: Mon Dec 28 10:47:43 2020 +0100
bbox: cleanup
Remove unused methods, make transform private
src/bbox.rs | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
---
diff --git a/src/bbox.rs b/src/bbox.rs
index d3f2d277..ab33f9a9 100644
--- a/src/bbox.rs
+++ b/src/bbox.rs
@@ -6,7 +6,7 @@ use crate::transform::Transform;
#[derive(Debug, Default, Copy, Clone)]
pub struct BoundingBox {
- pub transform: Transform,
+ transform: Transform,
pub rect: Option<Rect>, // without stroke
pub ink_rect: Option<Rect>, // with stroke
}
@@ -63,14 +63,6 @@ impl BoundingBox {
self.combine(src, true);
}
- pub fn rect_is_empty(&self) -> bool {
- self.rect.map_or(true, |r| r.is_empty())
- }
-
- pub fn ink_rect_is_empty(&self) -> bool {
- self.ink_rect.map_or(true, |r| r.is_empty())
- }
-
/// Creates a transform to map to the `self.rect`.
///
/// This depends on a `CoordUnits` parameter. When this is
@@ -85,7 +77,7 @@ impl BoundingBox {
match units {
CoordUnits::UserSpaceOnUse => Ok(Transform::identity()),
CoordUnits::ObjectBoundingBox => {
- if self.rect_is_empty() {
+ if self.rect.as_ref().map_or(true, |r| r.is_empty()) {
Err(())
} else {
let r = self.rect.as_ref().unwrap();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]