public override object Clone() { Vector2[] points = new Vector2[_points.Count]; int counter = 0; foreach (Vector2 vec in _points) { points[counter] = (Vector2)vec.Clone(); counter++; } Stroke2 shape = new Stroke2(points); return(shape); }
public bool Touch(Stroke2 inStroke) { Polygon2 selfPoly = (Polygon2)GeoConverter.Convert(this, ShapeType.Polygon); Vector2 lastPoint = null; foreach (Vector2 vec in inStroke.Points) { if (lastPoint != null) { for (int i = 0; i < 4; i++) { if (Line.LineIntersectsLine(selfPoly.Points[0 + i], selfPoly.Points[(1 + i) % 4], vec, lastPoint)) { return(true); } } } lastPoint = new Vector2(vec.X, vec.Y); } return(false); }