[librsvg: 53/90] Reset back to the initial_affine before masking
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 53/90] Reset back to the initial_affine before masking
- Date: Tue, 26 Mar 2019 19:16:31 +0000 (UTC)
commit 229f320b94ec92eff86a50483aa9aad06f727f5f
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Mar 19 19:15:32 2019 -0600
Reset back to the initial_affine before masking
rsvg_internals/src/drawing_ctx.rs | 4 ++++
rsvg_internals/src/mask.rs | 3 +--
2 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index de73e51e..1e2c1d63 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -539,6 +539,10 @@ impl DrawingCtx {
}
}
+ pub fn set_initial_affine(&self, cr: &cairo::Context) {
+ cr.set_matrix(self.initial_affine);
+ }
+
/// Saves the current Cairo matrix, runs the draw_fn, and restores the matrix
///
/// This is slightly cheaper than a `cr.save()` / `cr.restore()`
diff --git a/rsvg_internals/src/mask.rs b/rsvg_internals/src/mask.rs
index 7072b6b0..78be20af 100644
--- a/rsvg_internals/src/mask.rs
+++ b/rsvg_internals/src/mask.rs
@@ -144,8 +144,7 @@ impl NodeMask {
let mask_surface = compute_luminance_to_alpha(&mask_content_surface, opacity)?;
let cr = draw_ctx.get_cairo_context();
-
- cr.identity_matrix();
+ draw_ctx.set_initial_affine(&cr);
cr.mask_surface(&mask_surface, 0.0, 0.0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]