[librsvg: 21/38] Always grow the stack in push_new_viewport()
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 21/38] Always grow the stack in push_new_viewport()
- Date: Tue, 29 Sep 2020 23:37:21 +0000 (UTC)
commit 3df8259db48e02b6d747bc7f5c3e9f2b3e12a63d
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]