[librsvg: 6/20] Gather all the values from the MeasuredSpan as early as possible




commit 166c0545b0225ea45962d1ae788af7b497ae573a
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Oct 19 18:39:31 2021 -0500

    Gather all the values from the MeasuredSpan as early as possible
    
    To avoid mspan.this, mspan.that in the rest of the loop.
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/616>

 src/text.rs | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/text.rs b/src/text.rs
index c38a68da..73c010a0 100644
--- a/src/text.rs
+++ b/src/text.rs
@@ -170,20 +170,20 @@ impl PositionedChunk {
 
             let layout = mspan.layout.clone();
             let values = mspan.values.clone();
-
-            let baseline_offset = compute_baseline_offset(&layout, &values, &params);
-
             let dx = mspan.dx;
             let dy = mspan.dy;
+            let advance = mspan.advance;
+
+            let baseline_offset = compute_baseline_offset(&layout, &values, &params);
 
             let start_pos = match measured.values.direction() {
                 Direction::Ltr => (x, y),
-                Direction::Rtl => (x - mspan.advance.0, y),
+                Direction::Rtl => (x - advance.0, y),
             };
 
             let span_advance = match measured.values.direction() {
-                Direction::Ltr => (mspan.advance.0, mspan.advance.1),
-                Direction::Rtl => (-mspan.advance.0, mspan.advance.1),
+                Direction::Ltr => (advance.0, advance.1),
+                Direction::Rtl => (-advance.0, advance.1),
             };
 
             let rendered_position = if text_writing_mode.is_horizontal() {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]