Flip X dir; change x,y to float type