BBGamelib.ccUtils.RectUnion C# (CSharp) Method

RectUnion() public static method

public static RectUnion ( Rect a, Rect b ) : Rect
a UnityEngine.Rect
b UnityEngine.Rect
return UnityEngine.Rect
		public static Rect RectUnion(Rect a, Rect b) { 
			float x1 = Math.Min(a.x, b.x);
			float x2 = Math.Max(a.x + a.width, b.x + b.width); 
			float y1 = Math.Min(a.y, b.y);
			float y2 = Math.Max(a.y + a.height, b.y + b.height);

			return new Rect(x1, y1, x2 - x1, y2 - y1); 
		}