rust/landgen/src/outline.rs
changeset 14128 6a3bcb7c2981
parent 14127 5c1ce63114a5
child 14129 36b792842d5b
equal deleted inserted replaced
14127:5c1ce63114a5 14128:6a3bcb7c2981
   103 
   103 
   104         let min_distance = 40;
   104         let min_distance = 40;
   105         // new point should fall inside this box
   105         // new point should fall inside this box
   106         let map_box = self.play_box.with_margin(min_distance);
   106         let map_box = self.play_box.with_margin(min_distance);
   107 
   107 
   108         let p = -segment.scaled_normal();
   108         let p = segment.scaled_normal();
   109         let mid_point = segment.center();
   109         let mid_point = segment.center();
   110 
   110 
   111         if (p.integral_norm() < min_distance as u32 * 3) || !map_box.contains_inside(mid_point) {
   111         if (p.integral_norm() < min_distance as u32 * 3) || !map_box.contains_inside(mid_point) {
   112             return None;
   112             return None;
   113         }
   113         }