[librsvg: 11/27] FontSize::to_user - renamed from normalize; use NormalizeParams
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 11/27] FontSize::to_user - renamed from normalize; use NormalizeParams
- Date: Mon, 10 May 2021 16:06:42 +0000 (UTC)
commit df6a9cf6b4ae3e2cc040ba0fb906ee59430dc6ca
Author: Federico Mena Quintero <federico gnome org>
Date: Fri May 7 20:25:05 2021 -0500
FontSize::to_user - renamed from normalize; use NormalizeParams
src/font_props.rs | 4 ++--
src/text.rs | 9 ++++-----
2 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/src/font_props.rs b/src/font_props.rs
index 645a3db3..c1baa99e 100644
--- a/src/font_props.rs
+++ b/src/font_props.rs
@@ -229,8 +229,8 @@ impl FontSize {
FontSize::Value(new_size)
}
- pub fn normalize(&self, values: &ComputedValues, params: &ViewParams) -> f64 {
- self.value().normalize(values, params)
+ pub fn to_user(&self, params: &NormalizeParams) -> f64 {
+ self.value().to_user(params)
}
}
diff --git a/src/text.rs b/src/text.rs
index 87430c1f..2466a1b7 100644
--- a/src/text.rs
+++ b/src/text.rs
@@ -798,11 +798,10 @@ fn create_pango_layout(
font_desc.set_weight(pango::Weight::from(values.font_weight()));
font_desc.set_stretch(pango::Stretch::from(values.font_stretch()));
- let params = draw_ctx.get_view_params();
+ let view_params = draw_ctx.get_view_params();
+ let params = NormalizeParams::new(values, &view_params);
- font_desc.set_size(to_pango_units(
- values.font_size().normalize(values, ¶ms),
- ));
+ font_desc.set_size(to_pango_units(values.font_size().to_user(¶ms)));
let layout = pango::Layout::new(&pango_context);
layout.set_auto_dir(false);
@@ -824,7 +823,7 @@ fn create_pango_layout(
attr_list.insert(
pango::Attribute::new_letter_spacing(to_pango_units(
- values.letter_spacing().normalize(values, ¶ms),
+ values.letter_spacing().normalize(values, &view_params),
))
.unwrap(),
);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]