public IntersectsWith ( |
||
rect | ${WP_core_Rectangle2D_method_intersectsWith_param_rect} | |
return | bool |
public bool IntersectsWith(Rectangle2D rect)
{
if ((this._width < 0.0) || (rect.Width < 0.0))
{
return false;
}
return (rect.Left <= this.Right) && (rect.Right >= this.Left) && (rect.Bottom <= this.Top) && (rect.Top >= this.Bottom);
}
//比较计算后bounds和每个bounds的相交 private bool computeIntersectWithAll(Rectangle2D bounds) { var boundsCollection = (Layer as ElementsLayer).BoundsCollection.Values; foreach (Rectangle2D rect in boundsCollection) { if (rect != null) { if (bounds.IntersectsWith(rect)) { return true; } } } foreach (Rectangle2D rect in orignalBounds) { if (rect != null) { if (bounds.IntersectsWith(rect)) { return true; } } } return false; }