Skip to content

Rename pointer API to reflect immediate hit-testing semantics #10

@cowboyd

Description

@cowboyd

Problem

setPointer in the render options suggests it's setting state for a future render, but Clay_SetPointerState actually performs immediate hit-testing against the current layout tree. The data flow is hidden behind a misleading name.

Proposal

Replace the current pointer render option and internal setPointer/getPointerOverIds pair with something like:

term.hitTest(x, y, down): PointerEvent[]

This makes the semantics clear: you pass coordinates in, you get element IDs out. No hidden state, no frame-behind confusion.

Context

Clay_SetPointerState walks the layout tree immediately and populates pointerOverIds. In our single-render() API it's called after reduce (which wraps BeginLayout/EndLayout), so it always tests against the frame that was just built. This is correct but non-obvious from the current naming.

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