[librsvg/librsvg-2.46] structure: marge "else if" in outer "if"
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/librsvg-2.46] structure: marge "else if" in outer "if"
- Date: Tue, 15 Oct 2019 16:46:38 +0000 (UTC)
commit ff6a63fbdf2b330843f0034ab40c3c741869b3c2
Author: Paolo Borelli <pborelli gnome org>
Date: Sun Oct 13 12:46:49 2019 +0200
structure: marge "else if" in outer "if"
rsvg_internals/src/structure.rs | 34 ++++++++++++++++------------------
1 file changed, 16 insertions(+), 18 deletions(-)
---
diff --git a/rsvg_internals/src/structure.rs b/rsvg_internals/src/structure.rs
index 2aea9d89..efce30d0 100644
--- a/rsvg_internals/src/structure.rs
+++ b/rsvg_internals/src/structure.rs
@@ -235,25 +235,23 @@ impl NodeTrait for NodeSvg {
// DrawingCtx's viewport, just use the SVG's intrinsic dimensions and see how far
// it wants to extend.
(svg_viewport, self.vbox)
+ } else if has_parent {
+ (svg_viewport, self.vbox)
} else {
- if has_parent {
- (svg_viewport, self.vbox)
- } else {
- (
- // The client's viewport overrides the toplevel's x/y/w/h viewport
- draw_ctx.toplevel_viewport(),
- // Use our viewBox if available, or try to derive one from
- // the intrinsic dimensions.
- self.vbox.or_else(|| {
- Some(ViewBox {
- x: 0.0,
- y: 0.0,
- width: svg_viewport.width,
- height: svg_viewport.height,
- })
- }),
- )
- }
+ (
+ // The client's viewport overrides the toplevel's x/y/w/h viewport
+ draw_ctx.toplevel_viewport(),
+ // Use our viewBox if available, or try to derive one from
+ // the intrinsic dimensions.
+ self.vbox.or_else(|| {
+ Some(ViewBox {
+ x: 0.0,
+ y: 0.0,
+ width: svg_viewport.width,
+ height: svg_viewport.height,
+ })
+ }),
+ )
};
draw_ctx.with_discrete_layer(node, values, clipping, &mut |dc| {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]