[librsvg: 12/18] Fix comment




commit 6f9b6f168af49223cdf967e23c76572ba1540c08
Author: Federico Mena Quintero <federico gnome org>
Date:   Mon Oct 25 19:53:50 2021 -0500

    Fix comment
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/621>

 src/text.rs | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/text.rs b/src/text.rs
index 02eb97ad..a9bd9d70 100644
--- a/src/text.rs
+++ b/src/text.rs
@@ -525,8 +525,14 @@ fn children_to_chunks(
                 }
 
                 Element::Link(ref link) => {
-                    // TSpan::default tes all offsets to 0,
+                    // TSpan::default sets all offsets to 0,
                     // which is what we want in links.
+                    //
+                    // FIXME: This is the only place in the code where an element's method (TSpan::to_chunks)
+                    // is called with a node that is not the element itself: here, `child` is a Link, not a 
TSpan.
+                    //
+                    // The code works because the `tspan` is dropped immediately after calling to_chunks and 
no
+                    // references are retained for it.
                     let tspan = TSpan::default();
                     let cascaded = CascadedValues::new(cascaded, &child);
                     tspan.to_chunks(


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