[librsvg: 25/90] DrawingCtx.initial_affine - store the initial affine of the Cairo context



commit 821e801573f3babb2a2f7bb6ba7b06b69167977a
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Mar 13 12:01:03 2019 -0600

    DrawingCtx.initial_affine - store the initial affine of the Cairo context
    
    This will get used when figuring out the affine for temporary surfaces.

 rsvg_internals/src/drawing_ctx.rs | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index 20be14ae..f488c87f 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -84,6 +84,8 @@ pub enum ClipMode {
 pub struct DrawingCtx {
     svg: Rc<Svg>,
 
+    initial_affine: cairo::Matrix,
+
     rect: cairo::Rectangle,
     dpi: Dpi,
 
@@ -123,6 +125,8 @@ impl DrawingCtx {
         measuring: bool,
         testing: bool,
     ) -> DrawingCtx {
+        let initial_affine = cr.get_matrix();
+
         // This is more or less a hack to make measuring geometries possible,
         // while the code gets refactored not to need special cases for that.
 
@@ -161,6 +165,7 @@ impl DrawingCtx {
 
         DrawingCtx {
             svg,
+            initial_affine,
             rect,
             dpi,
             num_elements_rendered_through_use: 0,


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