Compare commits

..

3 Commits

Author SHA1 Message Date
Harrison Lambeth
34f81cf886
Merge b97bf246c8 into c73dffbb6f 2025-02-13 16:23:26 -05:00
Harrison Lambeth
b97bf246c8 Fix some things that broke after rebasing 2025-01-29 19:21:31 -07:00
Harrison Lambeth
3f39223eb4 Clay_GetElementIdsAtPoint 2025-01-29 19:07:45 -07:00
2 changed files with 2 additions and 36 deletions

View File

@ -177,7 +177,6 @@ For help starting out or to discuss clay, considering joining [the discord serve
- [Clay_PointerOver](#clay_pointerover) - [Clay_PointerOver](#clay_pointerover)
- [Clay_GetScrollContainerData](#clay_getscrollcontainerdata) - [Clay_GetScrollContainerData](#clay_getscrollcontainerdata)
- [Clay_GetElementId](#clay_getelementid) - [Clay_GetElementId](#clay_getelementid)
- [Clay_GetElementIdsAtPoint](#clay_getelementidsatpoint)
- [Element Macros](#element-macros) - [Element Macros](#element-macros)
- [CLAY](#clay-1) - [CLAY](#clay-1)
- [CLAY_ID](#clay_id) - [CLAY_ID](#clay_id)
@ -198,7 +197,6 @@ For help starting out or to discuss clay, considering joining [the discord serve
- [Clay_ScrollContainerData](#clay_scrollcontainerdata) - [Clay_ScrollContainerData](#clay_scrollcontainerdata)
- [Clay_ErrorHandler](#clay_errorhandler) - [Clay_ErrorHandler](#clay_errorhandler)
- [Clay_ErrorData](#clay_errordata) - [Clay_ErrorData](#clay_errordata)
- [Clay_PointQueryResult](#clay_pointqueryresult)
## High Level Documentation ## High Level Documentation
@ -730,14 +728,6 @@ Returns [Clay_ScrollContainerData](#clay_scrollcontainerdata) for the scroll con
Returns a [Clay_ElementId](#clay_elementid) for the provided id string, used for querying element info such as mouseover state, scroll container data, etc. Returns a [Clay_ElementId](#clay_elementid) for the provided id string, used for querying element info such as mouseover state, scroll container data, etc.
### Clay_GetElementIdsAtPoint
`Clay_PointQueryResult Clay_GetElementIdsAtPoint(Clay_Vector2 position)`
Returns a [Clay_PointQueryResult](#clay_pointqueryresult) that contains a sorted stack of element ids at the specified position. This allows querying elements similar to [Clay_SetPointerState](#clay_setpointerstate), but without triggering hover functions or affecting hover states.
> ⚠️ The returned Clay_PointQueryResult object becomes invalid the next time you call `Clay_GetElementIdsAtPoint`. If you need to call this multiple times in a frame, you will need to copy the data out of the Clay_PointQueryResult struct.
## Element Macros ## Element Macros
### CLAY() ### CLAY()
@ -2139,27 +2129,3 @@ A [Clay_String](#clay_string) that provides a human readable description of the
A generic pointer to extra userdata that is transparently passed through from `Clay_Initialize` to Clay's error handler callback. Defaults to NULL. A generic pointer to extra userdata that is transparently passed through from `Clay_Initialize` to Clay's error handler callback. Defaults to NULL.
--- ---
### Clay_PointQueryResult
```C
typedef struct
{
int32t length;
const Clay_ElementId *results;
} Clay_PointQueryResult;
```
**Fields**
**`.length`** - `int32_t`
The number of element ids contained in `.results`.
---
**`.results`** - `Clay_ElementId*`
A pointer to a sorted array of `.length` [Clay_ElementIds](#clay_elementid), starting with the root element.
---

4
clay.h
View File

@ -3752,8 +3752,8 @@ Clay_PointQueryResult Clay_GetElementIdsAtPoint(Clay_Vector2 position) {
} }
Clay_LayoutElement *rootElement = Clay_LayoutElementArray_Get(&context->layoutElements, root->layoutElementIndex); Clay_LayoutElement *rootElement = Clay_LayoutElementArray_Get(&context->layoutElements, root->layoutElementIndex);
if (found && Clay__ElementHasConfig(rootElement, CLAY__ELEMENT_CONFIG_TYPE_FLOATING) && if (found && Clay__ElementHasConfig(rootElement, CLAY__ELEMENT_CONFIG_TYPE_FLOATING_CONTAINER) &&
Clay__FindElementConfigWithType(rootElement, CLAY__ELEMENT_CONFIG_TYPE_FLOATING).floatingElementConfig->pointerCaptureMode == CLAY_POINTER_CAPTURE_MODE_CAPTURE) { Clay__FindElementConfigWithType(rootElement, CLAY__ELEMENT_CONFIG_TYPE_FLOATING_CONTAINER).floatingElementConfig->pointerCaptureMode == CLAY_POINTER_CAPTURE_MODE_CAPTURE) {
break; break;
} }
} }