Add intersect to rectangle.

This commit is contained in:
H. Utku Maden 2023-05-14 23:29:52 +03:00
parent 9339295378
commit fc1cc6a1ba

@ -321,6 +321,14 @@ namespace Quik
Min += offset;
Max += offset;
}
public static QuikRectangle Intersect(in QuikRectangle a, in QuikRectangle b) =>
new QuikRectangle(
Math.Min(a.Right, b.Right),
Math.Min(a.Top, b.Top),
Math.Max(a.Left, b.Left),
Math.Max(a.Bottom, b.Bottom)
);
}
/// <summary>