setCenter method

void setCenter(
  1. Coordinate point
)

Sets center of this Rect to be at this center point.

Implementation

void setCenter(Coordinate point)
{
  left = point.x - width * 0.5;
  top = point.y - height * 0.5;
}