When creating a line, a list of points is passed, but graphics::draw expects X/Y coordinates:
let (origin, dest) = (Point::new(0.0, 0.0), Point::new(0.0, 0.0));
let line = graphics::Mesh::new_line(ctx, &[origin, dest], 2.0, graphics::WHITE)?;
graphics::draw(ctx, &line, (Point2::new(0.0, 0.0),))?;
For rectangles, x, y, width and height are passed when creating a rectangle but graphics::draw expects X/Y coordinates:
let rectangle = graphics::Mesh::new_rectangle(
ctx,
graphics::DrawMode::fill(),
[0.0, 0.0, 30.0, 30.0].into(),
graphics::WHITE,
)?;
graphics::draw(ctx, &rectangle, (Point::new(0.0, 0.0),))?;
Why are both coordinates needed?