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

Method draw_poly

std/src/console/graphics.rs:726–742  ·  view source on GitHub ↗
(&mut self, points: &[PixelsXY])

Source from the content-addressed store, hash-verified

724 }
725
726 fn draw_poly(&mut self, points: &[PixelsXY]) -> io::Result<()> {
727 match points.len() {
728 0 => Ok(()),
729 1 => self.draw_pixel(points[0]),
730 2 => self.draw_line(points[0], points[1]),
731 3 => self.draw_tri(points[0], points[1], points[2]),
732 _ => {
733 if !poly_points(points) {
734 return Ok(());
735 }
736
737 self.raster_ops.set_draw_color(self.fg_color);
738 self.raster_ops.draw_poly(points)?;
739 self.present_canvas()
740 }
741 }
742 }
743
744 fn draw_poly_filled(&mut self, points: &[PixelsXY]) -> io::Result<()> {
745 match points.len() {

Callers

nothing calls this directly

Calls 7

poly_pointsFunction · 0.85
lenMethod · 0.45
draw_pixelMethod · 0.45
draw_lineMethod · 0.45
draw_triMethod · 0.45
set_draw_colorMethod · 0.45
present_canvasMethod · 0.45

Tested by

no test coverage detected