Skip to content

Latest commit

 

History

History
32 lines (17 loc) · 1.4 KB

en_nav_alg.md

File metadata and controls

32 lines (17 loc) · 1.4 KB

Element seaching alghorithm

The alghorithm is reasonable for any direction. "Upper edge" means an edge coincident with the movement direction. For the movement up - upper edge, down - bottom edge, right - right edge, left - left edge.

Example: There are navigation elements, focused element is marked in red.

slide1

User presses the button "Up". The first occuring thing is eliminating of elements that have upper edge lower then upper edge of the focused element.

slide2

The elements that have edges that intersect along the axis perpendicular to the direction are found. If there is any of such element exists then their priority become higher and other elements are eliminated.

slide3

The element that has upper edge closer to the upper edge of the focused element is searched for from the last elements.

slide4

If on the second step intersected elements haven't been found the closest element is found.

slide5

It's not a bug, it's a feature!

slide6

In this example moving vertically from the element B to the element A it's possible to transit the focus but not vise versa. It happens because of the bottom edge pf the element A is lower then the bottom edge of the element B. So A is higher and lower B at the same time.