protected virtual PointD Chop(Figure target, PointD point) { if (target == null) return new PointD (0, 0); else if (target.ContainsPoint (point.X, point.Y)) return target.DisplayBox.Center; double angle = Geometry.AngleFromPoint (DisplayBox, point); return Geometry.EdgePointFromAngle (DisplayBox, angle); }
protected override PointD Chop(Figure target, PointD point) { if (target.ContainsPoint (point.X, point.Y)) return target.DisplayBox.Center; double angle = Geometry.AngleFromPoint (DisplayBox, point); var p = new PointD (0.0, 0.0); RectangleD r = target.DisplayBox; p.X = r.Center.X + r.Width/2 * Math.Cos (angle); p.Y = r.Center.Y + r.Height/2 * Math.Sin (angle); return p; }