implemented manipulate a rectangle by a point