[librsvg: 10/20] Copy the layout_size from the MeasureSpan to the PositionedSpan




commit 54a47c4a04bd68118fecfd5f2272671af946eb83
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Oct 20 10:43:12 2021 -0500

    Copy the layout_size from the MeasureSpan to the PositionedSpan
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/616>

 src/text.rs | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/text.rs b/src/text.rs
index 332a4ad7..6fa25f12 100644
--- a/src/text.rs
+++ b/src/text.rs
@@ -70,7 +70,7 @@ struct Span {
 struct MeasuredSpan {
     values: Rc<ComputedValues>,
     layout: pango::Layout,
-    _layout_size: (f64, f64),
+    layout_size: (f64, f64),
     advance: (f64, f64),
     dx: f64,
     dy: f64,
@@ -78,6 +78,7 @@ struct MeasuredSpan {
 
 struct PositionedSpan {
     layout: pango::Layout,
+    layout_size: (f64, f64),
     values: Rc<ComputedValues>,
     rendered_position: (f64, f64),
     next_span_position: (f64, f64),
@@ -159,6 +160,7 @@ impl PositionedChunk {
             let params = NormalizeParams::new(&mspan.values, view_params);
 
             let layout = mspan.layout.clone();
+            let layout_size = mspan.layout_size;
             let values = mspan.values.clone();
             let dx = mspan.dx;
             let dy = mspan.dy;
@@ -187,11 +189,15 @@ impl PositionedChunk {
 
             let positioned_span = PositionedSpan {
                 layout,
+                layout_size,
                 values,
                 rendered_position,
                 next_span_position: (x, y),
             };
 
+            dbg!(positioned_span.rendered_position);
+            dbg!(positioned_span.next_span_position);
+
             positioned.push(positioned_span);
 
         }
@@ -317,7 +323,7 @@ impl MeasuredSpan {
         MeasuredSpan {
             values,
             layout,
-            _layout_size: (w, h),
+            layout_size: (w, h),
             advance,
             dx: span.dx,
             dy: span.dy,


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