Don't discard high-precision cursor position data#1375
Merged
goddessfreya merged 2 commits intorust-windowing:masterfrom Jan 10, 2020
Merged
Don't discard high-precision cursor position data#1375goddessfreya merged 2 commits intorust-windowing:masterfrom
goddessfreya merged 2 commits intorust-windowing:masterfrom
Conversation
Most platforms (X11, wayland, macos, stdweb, ...) provide physical positions in f64 units, which can contain meaningful fractional data. For example, this can be empirically observed on modern X11 using a typical laptop touchpad. This is useful for e.g. content creation tools, where cursor motion might map to brush strokes on a canvas with higher-than-screen resolution, or positioning of an object in a vector space.
Contributor
Author
|
It's also possible to get similar higher-quality data on Windows via e.g. |
murarth
reviewed
Jan 9, 2020
Contributor
|
This seems like a sensible change to me. Are there any objections? |
Co-Authored-By: Murarth <murarth@gmail.com>
murarth
approved these changes
Jan 9, 2020
goddessfreya
approved these changes
Jan 10, 2020
Contributor
|
Actually, I'd like to hold off on merging this and #1381 for now. I'd like to get the various bugfixes we've done on crates.io before doing a breaking release, since it hasn't even been a week since the last breaking release. |
Contributor
Author
|
Maybe make a 0.20.x branch? |
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Most platforms (X11, wayland, macos, stdweb, ...) provide physical positions in f64 units, which can contain meaningful fractional data. For example, this can be empirically observed on modern X11 using a typical laptop touchpad. This is useful for e.g. content creation tools, where cursor motion might map to brush strokes on a canvas with higher-than-screen resolution, or positioning of an object in a vector space.
I have not audited other uses of
PhysicalPosition. IMO there's a strong case for making it non-generic; it was difficult to trace the types of all uses even for this one event, and 64 bits ought to be enough for anyone.cargo fmthas been run on this branchcargo docbuilds successfullyCHANGELOG.mdif knowledge of this change could be valuable to users