-
Notifications
You must be signed in to change notification settings - Fork 5
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
Added direction.rs #22
Conversation
Added Direction enum: * North; * East; * South; * West. This enum is used to search the neighbor Rect in a given direction. Added functions: * find_north: find the north neighbor; * find_east: find the east neighbor; * find_south: find the south neighbor; * find_west: find the west neighbor; * find_neighbor: wrapper for the above functions. This commit is related to the leftwm issue "Directional Focus and Window movement (771)".
some more (pedantic) clippies
First of all, thanks for your contribution and very nice you added tests. A few thoughts:
Thats all I could catch so far. |
Hi, thanks a lot for your time, I will respond in line
This should be fixed with this commit
This should be fixed with this commit
Also fixed in this commit
Now the return is the return value of a function call.
Now the check is done using
Thanks again. Let me know if you see further improvement 😄 |
Thanks for taking your time to add these changes. Indeed there are some things I believe we could improve a little here: My idea for the doc comments were more like this:
As in my head it is "find neighbours to this edge" I would prefer the utility function Also renaming a couple of symbols would be nice:
Otherwise this looks arleady a lot cleaner and better readible. |
Hi, thanks again for your review and for your time. 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one single change to make it plural for consistency.
Otherwise lgtm.
Co-authored-by: VuiMuich <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good overall, thank you very much!
I commented on the implementation of search_nearest_neighbor
as I'm confident that we could make that code a bit more efficient.
The neighbor search is done using the rect coordinates; this is much more efficient compared to searching pixel by pixel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for doing this PR, @marianomarciello! Apologies that it has fallen between the cracks. This appears to be good to me so I will go ahead and merge it tomorrow around 0400Z provided there are no requested changes.
Best,
Mau
Hi @mautamu thanks for your time :) |
I'm good with this being merged. I apologize for keeping you hanging @marianomarciello, this somehow wasn't on my radar anymore. Great work, and thank you so much for your contribution :) ❤️ |
I published this as 0.9.0 |
Added Direction enum:
This enum is used to search the neighbor Rect in a given direction.
Added functions:
This commit is related to the leftwm issue "Directional Focus and Window movement (771)".