rust/landgen/src/outline.rs
changeset 14111 5c1ce63114a5
parent 14110 7e25f4800af8
child 14112 6a3bcb7c2981
--- a/rust/landgen/src/outline.rs	Sat Nov 03 02:16:13 2018 +0300
+++ b/rust/landgen/src/outline.rs	Sat Nov 03 02:21:45 2018 +0300
@@ -105,10 +105,7 @@
         // new point should fall inside this box
         let map_box = self.play_box.with_margin(min_distance);
 
-        let p = Point::new(
-            segment.end.y - segment.start.y,
-            segment.start.x - segment.end.x,
-        );
+        let p = -segment.scaled_normal();
         let mid_point = segment.center();
 
         if (p.integral_norm() < min_distance as u32 * 3) || !map_box.contains_inside(mid_point) {