[librsvg] inches_to_pixels(): Inline in one of its callers



commit cbdc421d2e1f48edb71a2d2a7f2fdfdf7af29b67
Author: Federico Mena Quintero <federico gnome org>
Date:   Mon Jan 21 18:48:02 2019 -0600

    inches_to_pixels(): Inline in one of its callers

 rsvg_internals/src/length.rs | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/rsvg_internals/src/length.rs b/rsvg_internals/src/length.rs
index e8703239..80086c55 100644
--- a/rsvg_internals/src/length.rs
+++ b/rsvg_internals/src/length.rs
@@ -177,7 +177,13 @@ impl Length {
 
             LengthUnit::FontEx => self.length * font_size_from_values(values, params) / 2.0,
 
-            LengthUnit::Inch => inches_to_pixels(self.length, self.dir, params),
+            LengthUnit::Inch => match self.dir {
+                LengthDir::Horizontal => self.length * params.dpi_x(),
+                LengthDir::Vertical => self.length * params.dpi_y(),
+                LengthDir::Both => {
+                    self.length * viewport_percentage(params.dpi_x(), params.dpi_y())
+                }
+            },
         }
     }
 


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