private void DrawTargetArrow(Graphics graphics, RectangleF target) { PointF cp = Grasshopper.GUI.GH_GraphicsUtil.BoxClosestPoint(Pivot, target); double distance = Grasshopper.GUI.GH_GraphicsUtil.Distance(Pivot, cp); if (distance < OuterRadius) { return; } Circle circle = new Circle(new Point3d(Pivot.X, Pivot.Y, 0.0), OuterRadius - 2); PointF tp = GH_Convert.ToPointF(circle.ClosestPoint(new Point3d(cp.X, cp.Y, 0.0))); Pen arrowPen = new Pen(Color.HotPink, OuterRadius - InnerRadius); arrowPen.EndCap = System.Drawing.Drawing2D.LineCap.RoundAnchor; graphics.DrawLine(arrowPen, tp, cp); arrowPen.Dispose(); }