Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't discard high-precision cursor position data #1375

Merged
merged 2 commits into from
Jan 10, 2020

Conversation

Ralith
Copy link
Contributor

@Ralith Ralith commented Jan 8, 2020

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.

  • Tested on all platforms changed
  • Compilation warnings were addressed
  • cargo fmt has been run on this branch
  • cargo doc builds successfully
  • Added an entry to CHANGELOG.md if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality
  • Updated feature matrix, if new features were added or implemented

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.
@Ralith
Copy link
Contributor Author

Ralith commented Jan 9, 2020

It's also possible to get similar higher-quality data on Windows via e.g. WM_POINTER, though winit's current implementation does not do so.

CHANGELOG.md Outdated Show resolved Hide resolved
@murarth
Copy link
Contributor

murarth commented Jan 9, 2020

This seems like a sensible change to me. Are there any objections?

Co-Authored-By: Murarth <murarth@gmail.com>
@goddessfreya goddessfreya added the S - api Design and usability label Jan 10, 2020
@goddessfreya goddessfreya merged commit 4b618bd into rust-windowing:master Jan 10, 2020
@Osspial
Copy link
Contributor

Osspial commented Jan 10, 2020

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.

@Ralith
Copy link
Contributor Author

Ralith commented Jan 10, 2020

Maybe make a 0.20.x branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S - api Design and usability
Development

Successfully merging this pull request may close these issues.

4 participants