Re: [csswg-drafts] [css-nav-1] Tweak the distance function to prioritize elements that are aligned (#3388)

---

Migrated from https://github.com/WICG/spatial-navigation/issues/122#issuecomment-433053747
Originally created by @cynthia on *Thu, 25 Oct 2018 13:36:30 GMT*

---
I've tried a quick and dirty prototype that computes the delta between the desired direction's reference angle and the angle between the currently focused element's centroid and the candidate element's centroid with an arctangent2, and it seems to improve performance a bit. @jihyerish knows how the strawman algorithm works, but the weights and magnitude have to be scaled to match the other ABCD scores in the distance computation phase.

Whether or not you factor this in is entirely up to you, but it seems to help.

-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3388#issuecomment-443619579 using your GitHub account

Received on Monday, 3 December 2018 07:55:03 UTC