rust/landgen/src/outline.rs
changeset 14151 ab280be4b617
parent 14147 32383b888309
child 14153 95360f56db38
equal deleted inserted replaced
14150:703242ade2c1 14151:ab280be4b617
   108                     (iy - m.y) * p.x / p.y + m.x
   108                     (iy - m.y) * p.x / p.y + m.x
   109                 } else {
   109                 } else {
   110                     (iy - s.y) * f.x / f.y + s.x
   110                     (iy - s.y) * f.x / f.y + s.x
   111                 };
   111                 };
   112 
   112 
   113                 let intersection_point = Point::new(ix, iy);
   113                 let intersection_point = Point::new(ix, iy).fit(intersections_box);
   114                 let diff_point = m - intersection_point;
   114                 let diff_point = m - intersection_point;
   115                 let t = p.dot(diff_point);
   115                 let t = p.dot(diff_point);
   116                 if diff_point.max_norm() >= std::i16::MAX as i32 {
   116                 if diff_point.max_norm() >= std::i16::MAX as i32 {
   117                     Some((t, std::i32::MAX as u32))
   117                     Some((t, std::i32::MAX as u32))
   118                 } else {
   118                 } else {