use unscaled mouse coordinates for convex hull test (#6332) #6370
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #6220
Description
In high DPI environment, most tooltips opened by the mouse close immediately.
This is because the SafeArea uses unscaled coordinates, while the current mouse point uses scaled coordinates. In high DPI, these are different, leading to false negatives from the containment test "is the mouse within the SafeArea".
Fixed by using unscaled coordinates for the mouse point. (And incidentally improving the perf by avoiding a lot of unnecessary transformations into, and out of, scaled coordinates.)
Customer Impact
Make ToolTips great again (in high DPI).
Regression
Regression in PR #5931.
Testing
Tested by hand, but thoroughly, in .NET 4.8.1. The automated tests don't cover high DPI, unless you explicitly run them on a machine whose primary monitor is high DPI.
This is a straightforward port of the .NET Fx fix but should be tested in .NET Core anyway.
Risk
Low
Microsoft Reviewers: Open in CodeFlow