using System.Windows;
//判断两个矩形是否有交集
public bool isHitRects(Rect rect1, Rect rect2)
{
if (rect1.BottomRight.Y < rect2.TopLeft.Y || rect1.TopLeft.Y > rect2.BottomLeft.Y || rect1.TopRight.X < rect2.TopLeft.X || rect1.TopLeft.X > rect2.TopRight.X)
{
return false;
}
return true;
}