rust/landgen/src/outline.rs
changeset 14118 400864ecb954
parent 14116 b2feb190e4bc
child 14121 4d22be35cfa2
--- a/rust/landgen/src/outline.rs	Fri Nov 02 22:41:11 2018 +0300
+++ b/rust/landgen/src/outline.rs	Fri Nov 02 22:50:45 2018 +0300
@@ -193,14 +193,15 @@
     }
 
     pub fn mirror(&mut self) {
+        let width = self.size.width as i32;
         self.iter_mut()
-            .for_each(|p| p.x = self.size.width() - 1 - p.x);
+            .for_each(|p| p.x = width - 1 - p.x);
     }
 
     pub fn flip(&mut self) {
-        points
-            .iter_mut()
-            .for_each(|p| p.y = self.size.height() - 1 - p.y);
+        let height = self.size.height as i32;
+        self.iter_mut()
+            .for_each(|p| p.y = height - 1 - p.y);
     }
 }