[librsvg/librsvg-2.44] BoundingBox::with_ink_rect() - new method, analogous to with_ink_extents()



commit 65f96bd6ff535ee795ec5d32414db120ffeab748
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Sep 25 18:12:15 2018 -0500

    BoundingBox::with_ink_rect() - new method, analogous to with_ink_extents()

 rsvg_internals/src/bbox.rs | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/rsvg_internals/src/bbox.rs b/rsvg_internals/src/bbox.rs
index d5a66ebf..e4a80f96 100644
--- a/rsvg_internals/src/bbox.rs
+++ b/rsvg_internals/src/bbox.rs
@@ -23,14 +23,16 @@ impl BoundingBox {
         BoundingBox { rect, ..self }
     }
 
+    pub fn with_ink_rect(self, ink_rect: Option<cairo::Rectangle>) -> BoundingBox {
+        BoundingBox { ink_rect, ..self }
+    }
+
     pub fn with_extents(self, extents: (f64, f64, f64, f64)) -> BoundingBox {
-        let rect = rect_from_extents(extents);
-        BoundingBox { rect, ..self }
+        self.with_rect(rect_from_extents(extents))
     }
 
     pub fn with_ink_extents(self, extents: (f64, f64, f64, f64)) -> BoundingBox {
-        let ink_rect = rect_from_extents(extents);
-        BoundingBox { ink_rect, ..self }
+        self.with_ink_rect(rect_from_extents(extents))
     }
 
     fn combine(&mut self, src: &BoundingBox, clip: bool) {


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