[librsvg] inches_to_pixels(): Inline in one of its callers
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] inches_to_pixels(): Inline in one of its callers
- Date: Tue, 22 Jan 2019 01:48:26 +0000 (UTC)
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]