[librsvg] NodeSvg.draw() - Use a few temporary variables
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] NodeSvg.draw() - Use a few temporary variables
- Date: Sat, 2 Mar 2019 01:48:28 +0000 (UTC)
commit a73bdf0f9b6c95d5b286f2dfc7f79bc93c024904
Author: Federico Mena Quintero <federico gnome org>
Date: Fri Mar 1 18:40:49 2019 -0600
NodeSvg.draw() - Use a few temporary variables
rsvg_internals/src/structure.rs | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/rsvg_internals/src/structure.rs b/rsvg_internals/src/structure.rs
index f67c2a51..ca1fb69d 100644
--- a/rsvg_internals/src/structure.rs
+++ b/rsvg_internals/src/structure.rs
@@ -271,16 +271,25 @@ impl NodeTrait for NodeSvg {
let params = draw_ctx.get_view_params();
- let clip_mode = if !values.is_overflow() && node.get_parent().is_some() {
+ let has_parent = node.get_parent().is_some();
+
+ let clip_mode = if !values.is_overflow() && has_parent {
Some(ClipMode::ClipToViewport)
} else {
None
};
+ let (viewport, vbox) = {
+ let viewport = self.get_viewport(values, ¶ms);
+ let vbox = self.vbox.get();
+
+ (viewport, vbox)
+ };
+
draw_in_viewport(
- &self.get_viewport(values, ¶ms),
+ &viewport,
clip_mode,
- self.vbox.get(),
+ vbox,
self.preserve_aspect_ratio.get(),
node,
values,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]