fix set dot bug and add basic draw line function

draw line function only can be used for the line whose slope is 0<=k<=1
and x2>x1, y2>y1.