fixet getRectPoints function.