Returns true if the polygon has at least one non-degenerate edge.
(points: &[PixelsXY])
| 130 | |
| 131 | /// Returns true if the polygon has at least one non-degenerate edge. |
| 132 | fn poly_points(points: &[PixelsXY]) -> bool { |
| 133 | points.windows(2).any(|ps| ps[0] != ps[1]) |
| 134 | || (points.len() > 2 && points.first() != points.last()) |
| 135 | } |
| 136 | |
| 137 | /// Given two points, calculates the origin and size of the rectangle they define. |
| 138 | fn rect_points(x1y1: PixelsXY, x2y2: PixelsXY) -> Option<(PixelsXY, SizeInPixels)> { |
no test coverage detected