[librsvg: 1/3] ComputedValues: compute font-size before its dependent properties
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 1/3] ComputedValues: compute font-size before its dependent properties
- Date: Sat, 15 Feb 2020 02:59:36 +0000 (UTC)
commit 76cba6e2d64dc48c66db846c59b20e3317ed99a7
Author: Federico Mena Quintero <federico gnome org>
Date: Thu Feb 13 18:38:05 2020 -0600
ComputedValues: compute font-size before its dependent properties
rsvg_internals/src/properties.rs | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/rsvg_internals/src/properties.rs b/rsvg_internals/src/properties.rs
index ba78c485..ac1ff6fc 100644
--- a/rsvg_internals/src/properties.rs
+++ b/rsvg_internals/src/properties.rs
@@ -469,6 +469,13 @@ impl SpecifiedValues {
}
pub fn to_computed_values(&self, computed: &mut ComputedValues) {
+ // First, compute font. It needs to be done before everything
+ // else, so that properties that depend on its computed value
+ // will be able to use it. For example, baseline-shift
+ // depends on font-size.
+ compute_value!(self, computed, font_size);
+
+ // Then, do all the other properties.
compute_value!(self, computed, baseline_shift);
compute_value!(self, computed, clip_path);
compute_value!(self, computed, clip_rule);
@@ -484,7 +491,6 @@ impl SpecifiedValues {
compute_value!(self, computed, flood_color);
compute_value!(self, computed, flood_opacity);
compute_value!(self, computed, font_family);
- compute_value!(self, computed, font_size);
compute_value!(self, computed, font_stretch);
compute_value!(self, computed, font_style);
compute_value!(self, computed, font_variant);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]