[librsvg: 3/8] Inline the call to draw_children() inside clip_to_node()




commit 48cea17decc3cdc8e2312619955e8e46dce28722
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Jun 1 19:19:17 2021 -0500

    Inline the call to draw_children() inside clip_to_node()
    
    A clipPath element should just accept certain kinds of children, not
    all elements.  We'll do that next.

 src/drawing_ctx.rs | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/src/drawing_ctx.rs b/src/drawing_ctx.rs
index cd76076f..7de70b60 100644
--- a/src/drawing_ctx.rs
+++ b/src/drawing_ctx.rs
@@ -501,19 +501,21 @@ impl DrawingCtx {
             let orig_transform = self.get_transform();
             self.cr.transform(node_transform.into());
 
-            // here we don't push a layer because we are clipping
-            let res = node.draw_children(acquired_nodes, &cascaded, self, true);
+            for child in node.children().filter(|c| c.is_element()) {
+                child.draw(
+                    acquired_nodes,
+                    &CascadedValues::new(&cascaded, &child),
+                    self,
+                    true,
+                )?;
+            }
 
             self.cr.clip();
 
             self.cr.set_matrix(orig_transform.into());
-
-            // Clipping paths do not contribute to bounding boxes, so ignore the bbox from
-            // the clip path.
-            res.map(|_bbox| ())
-        } else {
-            Ok(())
         }
+
+        Ok(())
     }
 
     fn generate_cairo_mask(


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]