[librsvg: 2/5] text: Propagate dx/dy across nested <tspan>
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 2/5] text: Propagate dx/dy across nested <tspan>
- Date: Thu, 5 Nov 2020 02:11:20 +0000 (UTC)
commit ba41e669504d7ef85bc23d25b9f68abdda187d6c
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Nov 3 19:45:30 2020 -0600
text: Propagate dx/dy across nested <tspan>
src/text.rs | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/text.rs b/src/text.rs
index e73517b2..9af19fe8 100644
--- a/src/text.rs
+++ b/src/text.rs
@@ -293,6 +293,8 @@ fn children_to_chunks(
&cascaded,
draw_ctx,
chunks,
+ dx,
+ dy,
depth + 1,
);
}
@@ -603,6 +605,8 @@ impl TSpan {
cascaded: &CascadedValues<'_>,
draw_ctx: &mut DrawingCtx,
chunks: &mut Vec<Chunk>,
+ dx: f64,
+ dy: f64,
depth: usize,
) {
let values = cascaded.get();
@@ -611,8 +615,11 @@ impl TSpan {
let x = self.x.map(|l| l.normalize(&values, ¶ms));
let y = self.y.map(|l| l.normalize(&values, ¶ms));
- let dx = self.dx.map_or(0.0, |l| l.normalize(&values, ¶ms));
- let dy = self.dy.map_or(0.0, |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 dx = dx + span_dx;
+ let dy = dy + span_dy;
chunks.push(Chunk::new(values, x, y));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]