fix bugs about center (x,y)