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

feat(CGDisplay): add displays_with_point and displays_with_rect #657

Merged
merged 4 commits into from
Aug 14, 2024

Conversation

mattjbray
Copy link
Contributor

Add CGDisplay::displays_with_point and CGDisplay::displays_with_rect.

Uses the pattern from CGDisplay::active_displays to first get the count of matching displays, then intialize the result Vec with vec![0; count as usize].

@mattjbray mattjbray force-pushed the cgdisplay-get-displays-with-point branch from 76a5f7b to 1a031c4 Compare March 13, 2024 14:06
@jrmuizel
Copy link
Collaborator

Can you add some tests?

@mattjbray
Copy link
Contributor Author

Can you add some tests?

Added some simple tests. I'm not sure how to test anything more specific without mocking the displays somehow - any pointers on how to do that would be appreciated.

@mattjbray
Copy link
Contributor Author

I've also added #[inline] attributes to match all the other fns in this module.

@mattjbray mattjbray force-pushed the cgdisplay-get-displays-with-point branch from d80fec5 to bf2881e Compare August 13, 2024 14:44
@wusyong wusyong added this pull request to the merge queue Aug 14, 2024
Merged via the queue into servo:main with commit 743b793 Aug 14, 2024
8 checks passed
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.

4 participants