public IBaseShape Overlaps(IBaseShape shape, Rect2 target, double radius, IHitTest hitTest, Modifier modifier) { if (!(shape is PathShape path)) { throw new ArgumentNullException("shape"); } foreach (var pathShape in path.Shapes) { var result = pathShape.Bounds?.Overlaps(pathShape, target, radius, hitTest, modifier); if (result != null) { return(result); } } var points = new List <IPointShape>(); path.GetPoints(points); if (points.Count == 0) { return(null); } return(HitTestHelper.Overlap(points, target) ? shape : null); }
public IBaseShape Overlaps(IBaseShape shape, Rect2 target, double radius, IHitTest hitTest, Modifier modifier) { if (!(shape is CubicBezierShape cubicBezier)) { throw new ArgumentNullException("shape"); } var points = new List <IPointShape>(); cubicBezier.GetPoints(points); return(HitTestHelper.Overlap(points, target) ? shape : null); }
public IBaseShape Overlaps(IBaseShape shape, Rect2 target, double radius, IHitTest hitTest, Modifier modifier) { if (!(shape is ConicShape conic)) { throw new ArgumentNullException("shape"); } var points = new List <IPointShape>(); conic.GetPoints(points); if (points.Count == 0) { return(null); } return(HitTestHelper.Overlap(points, target) ? shape : null); }