rust/landgen/src/outline.rs
changeset 14136 1dcd7e5e0aee
parent 14135 9eca6f2cac6d
child 14137 83bd383e6d11
equal deleted inserted replaced
14135:9eca6f2cac6d 14136:1dcd7e5e0aee
   208             let d = -(dist_right as i32)
   208             let d = -(dist_right as i32)
   209                 + min_distance
   209                 + min_distance
   210                 + random_numbers.next().unwrap() as i32
   210                 + random_numbers.next().unwrap() as i32
   211                     % (dist_right as i32 + dist_left as i32 - min_distance * 2);
   211                     % (dist_right as i32 + dist_left as i32 - min_distance * 2);
   212 
   212 
       
   213             let norm = p.integral_norm() as i32;
   213             Some(Point::new(
   214             Some(Point::new(
   214                 mid_point.x + p.x * d / p.integral_norm() as i32,
   215                 mid_point.x + p.x * d / norm,
   215                 mid_point.y + p.y * d / p.integral_norm() as i32,
   216                 mid_point.y + p.y * d / norm,
   216             ))
   217             ))
   217         }
   218         }
   218     }
   219     }
   219 
   220 
   220     fn divide_edges<I: Iterator<Item = u32>>(
   221     fn divide_edges<I: Iterator<Item = u32>>(