rust-windowing / rust-windowing/winit
Coordinate systems
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6.2k
- Forks
- 1.3k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 9
Description
While doing https://github.com/rust-windowing/winit/pull/3890, I reviewed all our instances of [Physical|Logical|]Position, and categorized them relative to their origin point:
Desktop coordinates:
MonitorHandle::positionWindowEvent::MovedWindow::outer_position/Window::set_outer_position
Window coordinates:
Window::surface_positionWindow::set_cursor_positionWindowEvent::Pointer*.position(from https://github.com/rust-windowing/winit/pull/3876) (maybe?)WindowEvent::Drag*.position(from https://github.com/rust-windowing/winit/pull/4079) (maybe?)
Surface coordinates:
Window::set_ime_cursor_areaWindow::show_window_menu
MouseScrollDelta::PixelDelta is a delta, so it has no origin and hence no coordinate system.
I believe that we should make set_cursor_position, WindowEvent::Pointer*.position and WindowEvent::Drag*.position use surface coordinates, since that's the easier coordinate system for users to work with.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the coordinate categories and API references in this issue, then read pull requests 3890, 3876, and 4079 for the related position behavior. Check how set_cursor_position, WindowEvent::Pointer*.position, and WindowEvent::Drag*.position are currently defined. Done means their coordinate origins are decided and documented consistently with the other listed APIs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100