public static Intersect ( |
||
a | ||
b | ||
리턴 |
public static RectangleF Intersect(RectangleF a, RectangleF b)
{
float num = Math.Max(a.X, b.X);
float num2 = Math.Min(a.X + a.Width, b.X + b.Width);
float num3 = Math.Max(a.Y, b.Y);
float num4 = Math.Min(a.Y + a.Height, b.Y + b.Height);
if (num2 >= num && num4 >= num3)
{
return new RectangleF(num, num3, num2 - num, num4 - num3);
}
return RectangleF.Empty;
}
RectangleF::Intersect ( |
public void Intersect(RectangleF rect) { RectangleF rectangleF = RectangleF.Intersect(rect, this); this.X = rectangleF.X; this.Y = rectangleF.Y; this.Width = rectangleF.Width; this.Height = rectangleF.Height; }