[librsvg/librsvg-2.50] Create the drawsub_stack in draw_tree(), not in DrawingCtx::new
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/librsvg-2.50] Create the drawsub_stack in draw_tree(), not in DrawingCtx::new
- Date: Fri, 2 Oct 2020 19:24:36 +0000 (UTC)
commit 0acb7ca90d9730b20164a2529df92f6996e734d2
Author: Federico Mena Quintero <federico gnome org>
Date: Fri Jun 19 17:42:54 2020 -0500
Create the drawsub_stack in draw_tree(), not in DrawingCtx::new
rsvg_internals/src/drawing_ctx.rs | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
---
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index 71da8650..f42b57bc 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -160,7 +160,6 @@ pub fn draw_tree(
cascaded: &CascadedValues<'_>,
) -> Result<BoundingBox, RenderingError> {
let mut draw_ctx = DrawingCtx::new(
- limit_to_stack,
cr,
viewport,
dpi,
@@ -168,12 +167,17 @@ pub fn draw_tree(
testing,
);
+ if let Some(limit_to_stack) = limit_to_stack {
+ for n in limit_to_stack.ancestors() {
+ draw_ctx.drawsub_stack.push(n.clone());
+ }
+ }
+
draw_ctx.draw_node_from_stack(node, acquired_nodes, cascaded, false)
}
impl DrawingCtx {
fn new(
- limit_to_stack: Option<&Node>,
cr: &cairo::Context,
viewport: Rect,
dpi: Dpi,
@@ -209,7 +213,7 @@ impl DrawingCtx {
let mut view_box_stack = Vec::new();
view_box_stack.push(vbox);
- let mut draw_ctx = DrawingCtx {
+ DrawingCtx {
initial_transform,
rect,
dpi,
@@ -219,15 +223,7 @@ impl DrawingCtx {
drawsub_stack: Vec::new(),
measuring,
testing,
- };
-
- if let Some(limit_to_stack) = limit_to_stack {
- for n in limit_to_stack.ancestors() {
- draw_ctx.drawsub_stack.push(n.clone());
- }
}
-
- draw_ctx
}
pub fn toplevel_viewport(&self) -> Rect {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]