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

Method draw_line

sdl/src/host.rs:525–534  ·  view source on GitHub ↗
(&mut self, x1y1: PixelsXY, x2y2: PixelsXY)

Source from the content-addressed store, hash-verified

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)

Callers 2

runFunction · 0.45
draw_logo_internalFunction · 0.45

Calls 1

point_xyFunction · 0.85

Tested by

no test coverage detected