[librsvg] font_size_from_values(): Inline the Em/Ex cases where it would call hand_normalize()
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] font_size_from_values(): Inline the Em/Ex cases where it would call hand_normalize()
- Date: Tue, 19 Feb 2019 19:54:45 +0000 (UTC)
commit 70a4539485cc840ea02aae86396d47b0cd5eed5e
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Feb 19 13:09:34 2019 -0600
font_size_from_values(): Inline the Em/Ex cases where it would call hand_normalize()
Let's see if we can remove hand_normalize() for good...
rsvg_internals/src/length.rs | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/rsvg_internals/src/length.rs b/rsvg_internals/src/length.rs
index 496ef9ef..a6c1d853 100644
--- a/rsvg_internals/src/length.rs
+++ b/rsvg_internals/src/length.rs
@@ -342,10 +342,11 @@ fn font_size_from_values(values: &ComputedValues, params: &ViewParams) -> f64 {
LengthUnit::Px => v.length,
- LengthUnit::Em | LengthUnit::Ex => {
- // This is the same default as used in NodeSvg::get_size()
- v.hand_normalize(0.0, 0.0, 12.0)
- }
+ // This is the same default as used in NodeSvg::get_size()
+ LengthUnit::Em => v.length * 12.0,
+
+ // This is the same default as used in NodeSvg::get_size()
+ LengthUnit::Ex => v.length * 12.0 / 2.0,
// FontSize always is a LengthDir::Both, per properties.rs
LengthUnit::In => v.length * LengthDir::Both.scaling_factor(params.dpi_x, params.dpi_y),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]