summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@gnome.org>2022-05-09 19:36:39 -0500
committerFederico Mena Quintero <federico@gnome.org>2022-05-09 20:33:00 -0500
commit44927afa05ece56341f08872393332202482f951 (patch)
treec9d37791c59ac3e98e6a64a9070b6c869af8365e
parentb4170e31ab6eb9aecea5a779fd4aea4a310510c2 (diff)
downloadlibrsvg-44927afa05ece56341f08872393332202482f951.tar.gz
(#823): Fix geometry computation for individual layers
(#823) correctly points out that commit e3bb911b2cd860e4e4671c87ea9712913bb35d26 broke geometry computation. I didn't see how it could, since it didn't even have to do with extracting bounding boxes from elements. It turns out that I forgot to copy the DrawingCtx.drawsub_stack for the nested context. So, for an SVG with structure a b c -> with isolation context (due to non-100% opacity / etc.) d e f id="draw_only_this_one" g if one calls geometry_for_layer("draw_only_this_one"), draw_tree() would properly create a drawsub_stack like (a b c f), but then the nested rendering would go: stack_top=a stack_top=b stack_top=c (creates isolation context, and a nested DrawingCtx) stack_top=empty (nested DrawingCtx has an empty drawsub_stack) -> draw every child of c since there's no drawsub_stack to limit it, instead of just drawing f in there. https://gitlab.gnome.org/GNOME/librsvg/-/issues/823 Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/697>
-rw-r--r--src/drawing_ctx.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/drawing_ctx.rs b/src/drawing_ctx.rs
index 41029551..cde3c61d 100644
--- a/src/drawing_ctx.rs
+++ b/src/drawing_ctx.rs
@@ -326,7 +326,7 @@ impl DrawingCtx {
cr,
user_language: self.user_language.clone(),
viewport_stack: self.viewport_stack.clone(),
- drawsub_stack: Vec::new(),
+ drawsub_stack: self.drawsub_stack.clone(),
measuring: self.measuring,
testing: self.testing,
}