private Rect CenterToRect(Rect rect, Rect to)
{
float num = Mathf.Clamp((float) (((float) ((int) (to.width - rect.width))) / 2f), (float) 0f, (float) 2.147484E+09f);
float num2 = Mathf.Clamp((float) (((float) ((int) (to.height - rect.height))) / 2f), (float) 0f, (float) 2.147484E+09f);
return new Rect(rect.x + num, rect.y + num2, rect.width, rect.height);
}