MCPcopy Index your code
hub / github.com/endbasic/endbasic / poly_points

Function poly_points

std/src/console/graphics.rs:132–135  ·  view source on GitHub ↗

Returns true if the polygon has at least one non-degenerate edge.

(points: &[PixelsXY])

Source from the content-addressed store, hash-verified

130
131/// Returns true if the polygon has at least one non-degenerate edge.
132fn 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.
138fn rect_points(x1y1: PixelsXY, x2y2: PixelsXY) -> Option<(PixelsXY, SizeInPixels)> {

Callers 2

draw_polyMethod · 0.85
draw_poly_filledMethod · 0.85

Calls 3

firstMethod · 0.80
lastMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected