vkommi
March 1, 2012, 11:00am
1
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.
walter
March 1, 2012, 11:28am
2
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.
Jake
March 5, 2012, 1:09pm
3
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);
}
}