Rounded Rectangle is not working properly

Hi,

I am using GORoundedRectangle to find some points are with in the shape or not.

Please see attached screen shot below.

If i check pink rectangle center point is with Rounded rectangle drawn on the picture i am getting result to true.

I think it should be outside the corner of the shape.

Please let me know how can i fix this problem.

That was an intentional design decision – note that it inherits from GoRectangle.

You can use a GoDrawing to get better hit-testing, at the expense of more overhead.

Or I suppose you could override ContainsPoint to be smarter.

This seems to work…

[Serializable]
public class RoundedRectWithContainsPt : GoRoundedRectangle
{
public override bool ContainsPoint(PointF p) {
if (!base.ContainsPoint§)
return false;

  GraphicsPath path = this.MakePath();
  return path.IsVisible(p);
}

}