mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-22 06:08:03 +00:00
Compare commits
2 Commits
a9e52f2305
...
1b29576583
Author | SHA1 | Date | |
---|---|---|---|
|
1b29576583 | ||
|
cbfa75e310 |
25
clay.h
25
clay.h
@ -393,6 +393,14 @@ typedef struct
|
|||||||
bool found;
|
bool found;
|
||||||
} Clay_ScrollContainerData;
|
} Clay_ScrollContainerData;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
Clay_BoundingBox elementLocation;
|
||||||
|
|
||||||
|
// Indicates whether an actual Element matched the provided ID or if the default struct was returned.
|
||||||
|
bool found;
|
||||||
|
} Clay_ElementLocationData;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
CLAY_RENDER_COMMAND_TYPE_NONE,
|
CLAY_RENDER_COMMAND_TYPE_NONE,
|
||||||
CLAY_RENDER_COMMAND_TYPE_RECTANGLE,
|
CLAY_RENDER_COMMAND_TYPE_RECTANGLE,
|
||||||
@ -480,6 +488,7 @@ void Clay_SetDebugModeEnabled(bool enabled);
|
|||||||
void Clay_SetCullingEnabled(bool enabled);
|
void Clay_SetCullingEnabled(bool enabled);
|
||||||
void Clay_SetMaxElementCount(uint32_t maxElementCount);
|
void Clay_SetMaxElementCount(uint32_t maxElementCount);
|
||||||
void Clay_SetMaxMeasureTextCacheWordCount(uint32_t maxMeasureTextCacheWordCount);
|
void Clay_SetMaxMeasureTextCacheWordCount(uint32_t maxMeasureTextCacheWordCount);
|
||||||
|
Clay_ElementLocationData Clay_GetElementLocationData (Clay_ElementId id);
|
||||||
|
|
||||||
// Internal API functions required by macros
|
// Internal API functions required by macros
|
||||||
void Clay__OpenElement(void);
|
void Clay__OpenElement(void);
|
||||||
@ -3847,6 +3856,22 @@ Clay_ScrollContainerData Clay_GetScrollContainerData(Clay_ElementId id) {
|
|||||||
return CLAY__INIT(Clay_ScrollContainerData) {};
|
return CLAY__INIT(Clay_ScrollContainerData) {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CLAY_WASM_EXPORT("Clay_GetElementLocationData")
|
||||||
|
Clay_ElementLocationData Clay_GetElementLocationData(Clay_ElementId id){
|
||||||
|
Clay_LayoutElementHashMapItem * item =Clay__GetHashMapItem(id.id);
|
||||||
|
if(item == &CLAY__LAYOUT_ELEMENT_HASH_MAP_ITEM_DEFAULT) {
|
||||||
|
return CLAY__INIT(Clay_ElementLocationData){
|
||||||
|
.found=false,
|
||||||
|
.elementLocation=CLAY__INIT(Clay_BoundingBox){}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return CLAY__INIT(Clay_ElementLocationData){
|
||||||
|
.elementLocation=item->boundingBox,
|
||||||
|
.found = true
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
CLAY_WASM_EXPORT("Clay_SetDebugModeEnabled")
|
CLAY_WASM_EXPORT("Clay_SetDebugModeEnabled")
|
||||||
void Clay_SetDebugModeEnabled(bool enabled) {
|
void Clay_SetDebugModeEnabled(bool enabled) {
|
||||||
Clay__debugModeEnabled = enabled;
|
Clay__debugModeEnabled = enabled;
|
||||||
|
Loading…
Reference in New Issue
Block a user