Skip to content

SetPointerState updates the pointerInfo.state only after onHoverFunctions are called #539

@spl3g

Description

@spl3g

So the function reflects the actual pointer state only on the next pointer event.
For example if i call Clay_SetPointerState on SDL_EVENT_MOUSE_BUTTON_DOWN:

case SDL_EVENT_MOUSE_BUTTON_DOWN:
  Clay_SetPointerState((Clay_Vector2) { event->button.x, event->button.y },
					   event->button.button == SDL_BUTTON_LEFT);
  break;

The onHover function will be provided with CLAY_POINTER_DATA_RELEASED state instead of CLAY_POINTER_DATA_PRESSED_THIS_FRAME. And only if i move the mouse or release the button, the state will be updated.
I don't know if it is intentional, but i had to edit clay.h for my program to function correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions