[librsvg/librsvg-2.48] ComputedValues: compute font-size before its dependent properties



commit 9a4c49c5f1536916909c6033fea747d0b6baf20d
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]