(&mut self, points: &[PixelsXY])
| 742 | } |
| 743 | |
| 744 | fn draw_poly_filled(&mut self, points: &[PixelsXY]) -> io::Result<()> { |
| 745 | match points.len() { |
| 746 | 0 => Ok(()), |
| 747 | 1 => self.draw_pixel(points[0]), |
| 748 | 2 => self.draw_line(points[0], points[1]), |
| 749 | 3 => self.draw_tri_filled(points[0], points[1], points[2]), |
| 750 | _ => { |
| 751 | if !poly_points(points) { |
| 752 | return Ok(()); |
| 753 | } |
| 754 | |
| 755 | self.raster_ops.set_draw_color(self.fg_color); |
| 756 | self.raster_ops.draw_poly_filled(points)?; |
| 757 | self.present_canvas() |
| 758 | } |
| 759 | } |
| 760 | } |
| 761 | |
| 762 | fn draw_rect(&mut self, x1y1: PixelsXY, x2y2: PixelsXY) -> io::Result<()> { |
| 763 | self.raster_ops.set_draw_color(self.fg_color); |
nothing calls this directly
no test coverage detected