Touch events emit screen coordinates instead of client coordinates on Windows#1042
Touch events emit screen coordinates instead of client coordinates on Windows#1042Osspial merged 3 commits intorust-windowing:masterfrom
Conversation
Osspial
left a comment
There was a problem hiding this comment.
Thanks for the PR!
This largely looks good, but it's losing some sub-pixel precision that we should be able to expose.
| let mut location = POINT { | ||
| x: input.x / 100, | ||
| y: input.y / 100, | ||
| }; |
There was a problem hiding this comment.
Doing the conversion like this loses the subpixel precision that the windows API provides. It should be possible to do the conversion to client-space and bring over the remainder.
| let mut location = POINT { | ||
| x: pointer_info.ptPixelLocation.x, | ||
| y: pointer_info.ptPixelLocation.y, | ||
| }; |
There was a problem hiding this comment.
This may be better-suited to another PR, but would it be possible to use ptHimetricLocation to get sub-pixel precision when handling this event? I should've caught that in the original PR, but I didn't look closely enough and didn't realize it was quite possible.
There was a problem hiding this comment.
Sure, i will look at it. I can open a new PR if you wish.
There was a problem hiding this comment.
Do whatever works best for you. Either option is fine by me.
There was a problem hiding this comment.
I've implemented it in a separate branch so i'll open a separate PR for it.
Yep! |
… Windows (rust-windowing#1042) * Touch events emit screen coordinates instead of client coordinates on Windows Fixes rust-windowing#1002 * Don't lose precision of WM_TOUCH events when converting from screen space to client space * Updated CHANGELOG.md to reflect changes from issue: rust-windowing#1042
Fixes #1002
I think this change should be reflected in CHANGELOG.md. Should i add it under "Unreleased"?
cargo fmthas been run on this branchCHANGELOG.mdif knowledge of this change could be valuable to users