[librsvg/librsvg-2.50] render_layer: make consistent with get_geometry_for_layer
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/librsvg-2.50] render_layer: make consistent with get_geometry_for_layer
- Date: Fri, 2 Oct 2020 19:24:37 +0000 (UTC)
commit d199595ca34aef85cae8beb4f5f955a068e37a32
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Sep 28 19:19:00 2020 -0500
render_layer: make consistent with get_geometry_for_layer
rsvg_internals/src/handle.rs | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
---
diff --git a/rsvg_internals/src/handle.rs b/rsvg_internals/src/handle.rs
index 92c95706..9ec2b552 100644
--- a/rsvg_internals/src/handle.rs
+++ b/rsvg_internals/src/handle.rs
@@ -240,22 +240,17 @@ impl Handle {
) -> Result<(), RenderingError> {
check_cairo_context(cr)?;
- let root = self.document.root();
-
- let mode = if let Some(id) = id {
- let node = self.lookup_node(id).map_err(RenderingError::InvalidId)?;
+ cr.save();
- DrawingMode::LimitToStack { node, root }
- } else {
- DrawingMode::OnlyNode(root)
- };
+ let node = self.get_node_or_root(id)?;
+ let root = self.document.root();
- cr.save();
+ let viewport = Rect::from(*viewport);
let res = draw_tree(
- mode,
+ DrawingMode::LimitToStack { node, root },
cr,
- Rect::from(*viewport),
+ viewport,
dpi,
false,
is_testing,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]