[librsvg/librsvg-2.50] Always grow the stack in push_new_viewport()



commit 241a47bc27af5cc862637b32b80438db8ac1d65b
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Sep 22 13:18:24 2020 -0500

    Always grow the stack in push_new_viewport()
    
    We didn't grow the stack if the new vbox would be the same as the last
    one (i.e. when the passed vbox == None).  Now we always grow the
    stack.  The idea is that eventually we'll be able to automatically
    restore the last viewport's transform on Drop.

 rsvg_internals/src/drawing_ctx.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index 73bbb4b8..bd6cc3f3 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -380,10 +380,10 @@ impl DrawingCtx {
                     if let Some(ClipMode::ClipToVbox) = clip_mode {
                         clip_to_rectangle(&self.cr, &*vbox);
                     }
-                    self.push_view_box(vbox.width(), vbox.height())
-                } else {
-                    self.get_view_params()
                 }
+
+                let vbox = vbox.unwrap_or_else(|| self.get_top_viewbox());
+                self.push_view_box(vbox.width(), vbox.height())
             })
     }
 


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