[librsvg] marker.rs: Compute the rotation with less code



commit 3f1a03f9db26d265f8089322e817d00be00d8d46
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Sep 27 19:07:58 2017 -0500

    marker.rs: Compute the rotation with less code

 rust/src/marker.rs |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/rust/src/marker.rs b/rust/src/marker.rs
index ddac9e7..f6f4ae9 100644
--- a/rust/src/marker.rs
+++ b/rust/src/marker.rs
@@ -126,12 +126,10 @@ impl NodeMarker {
 
         affine = cairo::Matrix::multiply (&affine, &drawing_ctx::get_current_state_affine (draw_ctx));
 
-        let rotation: f64;
-
-        match self.orient.get () {
-            MarkerOrient::Auto =>        { rotation = computed_angle; },
-            MarkerOrient::Degrees (d) => { rotation = d * PI / 180.0; }
-        }
+        let rotation = match self.orient.get () {
+            MarkerOrient::Auto =>        computed_angle,
+            MarkerOrient::Degrees (d) => d * PI / 180.0,
+        };
 
         affine.rotate (rotation);
 


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