[librsvg: 13/22] Remove unused fields




commit 571dc31dc0a76b1417d4ce46906b9b2967f05b29
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu Sep 23 10:58:49 2021 -0500

    Remove unused fields
    
    Now that the next PositionedSpan's position is computed in the loop,
    we don't need to carry it around in the last PositionedSpan.
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/593>

 src/text.rs | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)
---
diff --git a/src/text.rs b/src/text.rs
index 6114d913..be6f0db0 100644
--- a/src/text.rs
+++ b/src/text.rs
@@ -75,8 +75,6 @@ struct PositionedSpan {
     layout: pango::Layout,
     values: Rc<ComputedValues>,
     rendered_position: (f64, f64),
-    next_span_x: f64,
-    next_span_y: f64,
 }
 
 impl Chunk {
@@ -154,21 +152,16 @@ impl PositionedChunk {
                 (x + dx, y - offset + dy)
             };
 
-            let next_span_x = x + mspan.advance.0 + dx;
-            let next_span_y = y + mspan.advance.1 + dy;
-
             let positioned_span = PositionedSpan {
                 layout,
                 values,
                 rendered_position,
-                next_span_x,
-                next_span_y,
             };
 
-            x = next_span_x;
-            y = next_span_y;
-
             positioned.push(positioned_span);
+
+            x = x + mspan.advance.0 + dx;
+            y = y + mspan.advance.1 + dy;
         }
 
         PositionedChunk {


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