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

[NFC] servoshell: fix euclid units associated with winit geometry #30344

Merged
merged 2 commits into from Sep 14, 2023

Conversation

delan
Copy link
Sponsor Member

@delan delan commented Sep 12, 2023

The headed Window::get_coordinates multiplies screen sizes, window sizes, and window positions by a fake dip-to-dp scale factor to work around the fact that they were incorrectly marked as DeviceIndependentPixel, when winit’s PhysicalSize and PhysicalPosition types should actually be in DevicePixel.

This patch fixes those units and adds helper functions for converting winit types to euclid types, making our geometry calculations simpler and eliminating almost all of the untyped operations.


  • There are tests for these changes OR
  • These changes do not require tests because there are no functional changes

Base automatically changed from servoshell-clarify-dpr-override to master September 12, 2023 10:41
@delan delan mentioned this pull request Sep 12, 2023
27 tasks
Copy link
Member

@mrobinson mrobinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup. I have a couple nits below, but otherwise this is great.

ports/servoshell/headed_window.rs Outdated Show resolved Hide resolved
ports/servoshell/headed_window.rs Show resolved Hide resolved
@delan delan added this pull request to the merge queue Sep 13, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 13, 2023
@delan delan added this pull request to the merge queue Sep 14, 2023
Merged via the queue into master with commit 95bf68d Sep 14, 2023
10 checks passed
@delan delan deleted the servoshell-dip-n-dp branch September 14, 2023 11:56
@delan delan mentioned this pull request Sep 14, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants