(&mut self, x1y1: PixelsXY, x2y2: PixelsXY)
| 523 | } |
| 524 | |
| 525 | fn draw_line(&mut self, x1y1: PixelsXY, x2y2: PixelsXY) -> io::Result<()> { |
| 526 | if x1y1 == x2y2 { |
| 527 | // Paper over differences between platforms. On Linux, this would paint a single dot, |
| 528 | // but on Windows, it paints nothing. For consistency with drawing a circle of radius |
| 529 | // 0, and for consistency with the web interface, avoid painting anything here. |
| 530 | return Ok(()); |
| 531 | } |
| 532 | |
| 533 | self.canvas.draw_line(point_xy(x1y1), point_xy(x2y2)).map_err(string_error_to_io_error) |
| 534 | } |
| 535 | |
| 536 | fn draw_pixel(&mut self, xy: PixelsXY) -> io::Result<()> { |
| 537 | self.canvas.draw_point(point_xy(xy)).map_err(string_error_to_io_error) |
no test coverage detected