impl draw line using bresenham algorithm