Skip to content

Tweak the distance function to prioritize elements that are aligned #3361

Closed
@frivoal

Description

@frivoal

Migrated from WICG/spatial-navigation#122
Originally created by @frivoal on Wed, 17 Oct 2018 05:33:36 GMT


The current distance function behaves somewhat strangely, mostly due to:

  • measuring edge to edge, which does not help decide which element to go to when two targets are at the same distance from the source's edge, even if one is fully in aligned, and the other is not
  • The B factor in the formula penalizes elements which are aligned, in a way that is not fully compensated by C. Both in combination seem to favor elements at 0 or 90 degrees over those at 45 degrees, which does not seem justified.

We should:

  • Switch from measuring from edge to edge to measuring from center to edge
  • Drop the B factor, and possibly the C factor as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions