[librsvg/librsvg-2.50] text: Only push a new chunk if the tspan has any of x or y attributes
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/librsvg-2.50] text: Only push a new chunk if the tspan has any of x or y attributes
- Date: Thu, 5 Nov 2020 20:09:11 +0000 (UTC)
commit 1536107036326c9e711f25003dfecc05ceb1dd04
Author: Federico Mena Quintero <federico gnome org>
Date: Wed Nov 4 19:05:23 2020 -0600
text: Only push a new chunk if the tspan has any of x or y attributes
rsvg_internals/src/text.rs | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/rsvg_internals/src/text.rs b/rsvg_internals/src/text.rs
index 03f2be5d..0863e012 100644
--- a/rsvg_internals/src/text.rs
+++ b/rsvg_internals/src/text.rs
@@ -615,13 +615,12 @@ impl TSpan {
let x = self.x.map(|l| l.normalize(&values, ¶ms));
let y = self.y.map(|l| l.normalize(&values, ¶ms));
- let span_dx = self.dx.map_or(0.0, |l| l.normalize(&values, ¶ms));
- let span_dy = self.dy.map_or(0.0, |l| l.normalize(&values, ¶ms));
+ let span_dx = dx + self.dx.map_or(0.0, |l| l.normalize(&values, ¶ms));
+ let span_dy = dy + self.dy.map_or(0.0, |l| l.normalize(&values, ¶ms));
- let dx = dx + span_dx;
- let dy = dy + span_dy;
-
- chunks.push(Chunk::new(values, x, y));
+ if x.is_some() || y.is_some() {
+ chunks.push(Chunk::new(values, x, y));
+ }
children_to_chunks(
chunks,
@@ -629,8 +628,8 @@ impl TSpan {
acquired_nodes,
cascaded,
draw_ctx,
- dx,
- dy,
+ span_dx,
+ span_dy,
depth,
);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]