HitTest is buggy / not accurate when the UserControl's RenderTransform set to a large scale(ScaleX = ScaleY = 500)
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
### Description
.NET 6 or higher / WPF
I have set UserControl's RenderTransform to a ScaleTransform(ScaleX = ScaleY = 500), and set the UserControl's Template to be a Line shape. However, when running the application, I noticed that the mouse events of UserControl are triggered when the mouse click or move in the blank area near the line.
When I set the scale to a smaller value,like ScaleX = ScaleY = 1, I don't encounter this issue.
I find an similar problem here(https://social.msdn.microsoft.com/Forums/vstudio/en-US/8708e340-f734-4cf4-b91d-28b49fee2b72/hittest-is-buggy-not-accurate-for-transformed-scaled-etc-visuals?forum=wpf), but it seems that it has not been fixed yet.
Click in the blank area near the line:

### Reproduction Steps
My demo code in github: https://github.com/yao-xiaofei/ShapeTest
Here is my code:
```
```
### Expected behavior
My expectation is that when I set a larger scale value(ScaleX = ScaleY = 500 or larger), the UserControl should only respond to mouse events when clicking on the area of the line, and avoid triggering mouse events in the blank area.

### Actual behavior
The mouse events of UserControl are triggered when the mouse click or move in the blank area near the line.
Click in the blank area near the line:

### Regression?
_No response_
### Known Workarounds
_No response_
### Impact
_No response_
### Configuration
_No response_
### Other information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.