Replies: 1 comment
-
Hmm, nevermind. The |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Let's say my DPI is 150% (Windows) and I have a
View
that's 1500x1500 (CanvasWidth
byCanvasHeight
). Add aPointerGestureRecognizer
to it, and click right in the middle. Handle thePointerMoved
event and get the pointer coords usingPointerEventArgs.GetPosition((View)sender)
. The resulting coordinates won't be (750, 750), but rather (500, 500).If I change the DPI setting to 100% and repeat this experiment, the resulting coordinates are indeed (750, 750).
Is there something I need to do to have the DPI setting taken into consideration? Some coordinate conversion method I'm missing somewhere? I can use
DeviceDisplay.Current.MainDisplayInfo.Density
value to scale the position, but I personally feel this should be handled by theGetPosition
method itself. Maybe there's some other reason it's not though.Beta Was this translation helpful? Give feedback.
All reactions