Skip to content
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

fix: return [0, 0] from calculatePosition if camera projection fails #47

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

milesflavel
Copy link
Collaborator

Partially resolves #45 (comment) (bug from last bullet point)

@AlaricBaraou
Copy link
Collaborator

I'm not sure I understand this one.
I understand it can prevent a NaN but why would it remain stuck at [0,0] if the first one fail ?

@milesflavel
Copy link
Collaborator Author

milesflavel commented Feb 11, 2024

I'm not sure I understand this one. I understand it can prevent a NaN but why would it remain stuck at [0,0] if the first one fail ?

The problem arises when we check the value here https://github.com/pmndrs/react-three-a11y/pull/47/files#diff-32dc2dac919df01db7d6bf3121c0154e2f292742bf796529b3b19632da0dc7d7R143-R144

When the value is NaN, we never enter this condition, which means that we never update the value on this line https://github.com/pmndrs/react-three-a11y/pull/47/files#diff-32dc2dac919df01db7d6bf3121c0154e2f292742bf796529b3b19632da0dc7d7R155

Downstream this affects the rendered x,y positions, causing all elements to be rendered at a default position in the top-left corner perpetually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Touch events behave inconsistently with A11y
2 participants