Hi,
I have an Ellipse on a Canvas and I'm doing a Hit Testing on it.
Every time I click the stroke of the Ellipse, the test pass.
If I click in the middle of the Ellipse, the test fails.
This is good !
After I fill the ellipse like this: myEllipse.Fill = new SolidColorBrush(Colors.Blue);
the test pass also when I click in the middle of the Ellipse.
How can I disable this ?
(even when Ellipse is Filled, the test will fail when I click in the middle)
Thanks !

2 solutions

Solution 1

After I fill the ellipse like this: myEllipse.Fill = new SolidColorBrush(Colors.Blue);
the test pass also when I click in the middle of the Ellipse.
How can I disable this ?

You could draw the fill with a second ellipse inside the first one. Otherwise, you can check the mouse position inside the ellipse and calculate if it's on the edge or the middle. You certainly cannot create an object, and tell it to lie to you if you ask if the mouse is over it.