Пример #1
0
        public override bool IntersectsWith(Rectangle rect)
        {
            if (!IsValidEdge)
            {
                return(false);
            }

            for (int i = 0; i < _edgePoints.Count - 1; ++i)
            {
                if (RectUtil.IntersectsWith(rect, _edgePoints[i], _edgePoints[i + 1]))
                {
                    return(true);
                }
            }
            return(false);
        }
Пример #2
0
 public override bool IntersectsWith(Rectangle rect)
 {
     if (_points.Count > 1)
     {
         var translated = new Rectangle(
             rect.Location - (Size)Location,
             rect.Size
             );
         for (int i = 0; i < _points.Count - 1; ++i)
         {
             if (RectUtil.IntersectsWith(translated, _points[i], _points[i + 1]))
             {
                 return(true);
             }
         }
     }
     return(false);
 }