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

[Bug] Clay_OnHover does not receive CLAY_POINTER_DATA_RELEASED_THIS_FRAME state #154

Open
sonodima opened this issue Jan 3, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@sonodima
Copy link

sonodima commented Jan 3, 2025

The Clay_OnHover callback does not receive the CLAY_POINTER_DATA_RELEASED_THIS_FRAME event when the pointer state is updated as follows:

// (in the main loop, before layouting and rendering)

if (isTouching)
{
  Clay_SetPointerState((Clay_Vector2){touch.px, touch.py}, true);
}
else
{
  Clay_SetPointerState((Clay_Vector2){-1, -1}, false);
}

This behavior occurs in my use case with touchscreen input, where I only provide the pointer position when the screen is being touched.

STEPS TO REPRODUCE THE ISSUE:

When isPointerDown changes to false and position is updated to { -1, -1 }, the Clay_OnHover callback does not receive the CLAY_POINTER_DATA_RELEASED_THIS_FRAME pointer state.

However, if I cache the previous touch position and pass that togheter with the isPointerDown update to false, Clay_OnHover receives the correct pointer state update.

@nicbarker
Copy link
Owner

Thanks for reporting this one! Will get on it 👍

@nicbarker nicbarker added the bug Something isn't working label Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants