[librsvg] NodeMarker: Separate the function to get the default size



commit 3094d4bb9170aa36a46c6b907c53236579e80896
Author: Federico Mena Quintero <federico gnome org>
Date:   Mon Jan 21 13:30:14 2019 -0600

    NodeMarker: Separate the function to get the default size

 rsvg_internals/src/marker.rs | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/rsvg_internals/src/marker.rs b/rsvg_internals/src/marker.rs
index 3acaeb4c..ba12cd44 100644
--- a/rsvg_internals/src/marker.rs
+++ b/rsvg_internals/src/marker.rs
@@ -103,17 +103,22 @@ impl NodeMarker {
             units: Cell::new(MarkerUnits::default()),
             ref_x: Cell::new(Length::default()),
             ref_y: Cell::new(Length::default()),
-            width: Cell::new(NodeMarker::get_default_size(LengthDir::Horizontal)),
-            height: Cell::new(NodeMarker::get_default_size(LengthDir::Vertical)),
+            width: Cell::new(Self::default_width()),
+            height: Cell::new(Self::default_height()),
             orient: Cell::new(MarkerOrient::default()),
             aspect: Cell::new(AspectRatio::default()),
             vbox: Cell::new(None),
         }
     }
 
-    fn get_default_size(dir: LengthDir) -> Length {
+    fn default_width() -> Length {
         // per the spec
-        Length::parse_str("3", dir).unwrap()
+        Length::parse_str("3", LengthDir::Horizontal).unwrap()
+    }
+
+    fn default_height() -> Length {
+        // per the spec
+        Length::parse_str("3", LengthDir::Vertical).unwrap()
     }
 
     fn render(


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