[librsvg: 12/18] Fix comment
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 12/18] Fix comment
- Date: Tue, 26 Oct 2021 02:33:05 +0000 (UTC)
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]