bevyengine / bevyengine/bevy

`bevy_input_focus`: `min_alignment_factor` should also be applied to diagonals during navigation

Open
#23,195 1 comment 0 reactions 0 assignees View on GitHub
A-Input A-UI C-Refinement D-Straightforward S-Ready-For-Implementation X-Uncontroversial
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## What problem does this solve or what need does it fill?

The fact that` min_alignment_factor` only applies to the cardinal directions feels a bit off to me. It results in situations where you can, for example, navigate NorthEast and SouthEast to a node, but you cannot navigate East to it just because the node is not well aligned in the X direction. Granted, when you have a strict D-Pad that only supports four directions, this might not be a problem, but the logic supports eight directions.

I found this while working on my auto nav viz project. I’d attach a video of what I mean…. if GitHub ever allows me to upload some media in the next 24 hours.

## What solution would you like?

`calculate_overlap` in `bevy_input_focus` also applies to diagonal directions from each corner of the source node.

## What alternative(s) have you considered?

It seems particularly well documented that `min_alignment_factor` does not support diagonals, so if there is a reason why there is no support, I would like to know why this decision was made.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.