[librsvg: 1/9] BoundingBox: new functions rect_is_empty / ink_rect_is_empty



commit d6dc59d9fd0a583a2fd3ca3709d2181b114b6291
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Apr 29 13:38:00 2020 -0500

    BoundingBox: new functions rect_is_empty / ink_rect_is_empty

 rsvg_internals/src/bbox.rs | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/rsvg_internals/src/bbox.rs b/rsvg_internals/src/bbox.rs
index 8b6e50da..99593e1c 100644
--- a/rsvg_internals/src/bbox.rs
+++ b/rsvg_internals/src/bbox.rs
@@ -61,6 +61,14 @@ impl BoundingBox {
     pub fn clip(&mut self, src: &BoundingBox) {
         self.combine(src, true);
     }
+
+    pub fn rect_is_empty(&self) -> bool {
+        self.rect.map(|r| r.is_empty()).unwrap_or(true)
+    }
+
+    pub fn ink_rect_is_empty(&self) -> bool {
+        self.ink_rect.map(|r| r.is_empty()).unwrap_or(true)
+    }
 }
 
 fn combine_rects(


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]