[librsvg] Refactor push_new_viewport() a bit



commit ff7f6a20bda0334b7088da930e77e6b8e7114c27
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Feb 20 13:05:53 2019 -0600

    Refactor push_new_viewport() a bit

 rsvg_internals/src/drawing_ctx.rs | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index ee907d03..de33bb82 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -239,25 +239,25 @@ impl DrawingCtx {
             }
         }
 
-        preserve_aspect_ratio.viewport_to_viewbox_transform(vbox, viewport).and_then(|matrix| {
-            let params = if let Some(ref vbox) = vbox {
-                self.push_view_box(vbox.width, vbox.height)
-            } else {
-                self.get_view_params()
-            };
-
-            self.cr.transform(matrix);
-
-            if let Some(ref vbox) = vbox {
-                if let Some(ref clip) = clip_mode {
-                    if *clip == ClipMode::ClipToVbox {
-                        self.clip(vbox.x, vbox.y, vbox.width, vbox.height);
+        preserve_aspect_ratio
+            .viewport_to_viewbox_transform(vbox, viewport)
+            .and_then(|matrix| {
+                self.cr.transform(matrix);
+
+                if let Some(vbox) = vbox {
+                    let params = self.push_view_box(vbox.width, vbox.height);
+
+                    if let Some(ref clip) = clip_mode {
+                        if *clip == ClipMode::ClipToVbox {
+                            self.clip(vbox.x, vbox.y, vbox.width, vbox.height);
+                        }
                     }
-                }
-            }
 
-            Some(params)
-        })
+                    Some(params)
+                } else {
+                    Some(self.get_view_params())
+                }
+            })
     }
 
     pub fn insert_bbox(&mut self, bbox: &BoundingBox) {


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