AutoAsparagus.AutoAsparagus.clampToScreen C# (CSharp) Method

clampToScreen() static private method

static private clampToScreen ( Rect rect ) : Rect
rect UnityEngine.Rect
return UnityEngine.Rect
		internal static Rect clampToScreen (Rect rect)
		{
			rect.width = Mathf.Clamp (rect.width, 0, Screen.width);
			rect.height = Mathf.Clamp (rect.height, 0, Screen.height);
			rect.x = Mathf.Clamp (rect.x, 0, Screen.width - rect.width);
			rect.y = Mathf.Clamp (rect.y, 0, Screen.height - rect.height);
			return rect;
		}