[librsvg: 2/3] (#609): Apply the clip node's transform in DrawingCtx.clip_to_node()




commit 69eb88670824e18c8f7ea216f66f9ac9ab3e90de
Author: Sven Neumann <sven svenfoo org>
Date:   Thu Aug 20 16:38:59 2020 +0200

    (#609): Apply the clip node's transform in DrawingCtx.clip_to_node()
    
    Fixes https://gitlab.gnome.org/GNOME/librsvg/-/issues/609

 rsvg_internals/src/drawing_ctx.rs | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index b98f7c741..c105b257d 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -343,9 +343,14 @@ impl DrawingCtx {
         let units = borrow_element_as!(node, ClipPath).get_units();
 
         if let Ok(transform) = bbox.rect_to_transform(units) {
+            let node_transform = node
+                .borrow_element()
+                .get_transform()
+                .post_transform(&transform);
+
             let cascaded = CascadedValues::new_from_node(node);
 
-            self.with_saved_transform(Some(transform), &mut |dc| {
+            self.with_saved_transform(Some(node_transform), &mut |dc| {
                 let cr = dc.get_cairo_context();
 
                 // here we don't push a layer because we are clipping


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