Bresenham's line algorithm in canvas