[librsvg: 10/15] Inline with_saved_transform into DrawingCtx.clip_to_node()
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 10/15] Inline with_saved_transform into DrawingCtx.clip_to_node()
- Date: Tue, 24 Nov 2020 18:09:22 +0000 (UTC)
commit 83ac980a50b4fff816b4e6249a9cc9670bcdece0
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Nov 17 19:47:52 2020 -0600
Inline with_saved_transform into DrawingCtx.clip_to_node()
Clipping paths don't accumulate bboxes, so we discard the bbox result
of with_saved_transform(), so the interesting part of
with_saved_transform() is not needed here. We will remove that function soon.
src/drawing_ctx.rs | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/drawing_ctx.rs b/src/drawing_ctx.rs
index cd0ba515..b693e083 100644
--- a/src/drawing_ctx.rs
+++ b/src/drawing_ctx.rs
@@ -448,19 +448,19 @@ impl DrawingCtx {
let cascaded = CascadedValues::new_from_node(node);
- self.with_saved_transform(Some(node_transform), &mut |dc| {
- let cr = dc.cr.clone();
+ 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, dc, true);
+ // here we don't push a layer because we are clipping
+ let res = node.draw_children(acquired_nodes, &cascaded, self, true);
- cr.clip();
+ self.cr.clip();
+
+ self.cr.set_matrix(orig_transform.into());
- res
- })
// Clipping paths do not contribute to bounding boxes (they should, but we
// need Real Computational Geometry(tm), so ignore the bbox from the clip path.
- .map(|_bbox| ())
+ res.map(|_bbox| ())
} else {
Ok(())
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]