mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-19 04:38:01 +00:00
Expose getter for max element counts
This commit is contained in:
parent
73d2186d95
commit
f186024e74
15
clay.h
15
clay.h
@ -3975,9 +3975,22 @@ void Clay_SetExternalScrollHandlingEnabled(bool enabled) {
|
|||||||
context->externalScrollHandlingEnabled = enabled;
|
context->externalScrollHandlingEnabled = enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CLAY_WASM_EXPORT("Clay_GetMaxElementCount")
|
||||||
|
int32_t Clay_GetMaxElementCount(void) {
|
||||||
|
Clay_Context* context = Clay_GetCurrentContext();
|
||||||
|
return context->maxElementCount;
|
||||||
|
}
|
||||||
|
|
||||||
CLAY_WASM_EXPORT("Clay_SetMaxElementCount")
|
CLAY_WASM_EXPORT("Clay_SetMaxElementCount")
|
||||||
void Clay_SetMaxElementCount(int32_t maxElementCount) {
|
void Clay_SetMaxElementCount(int32_t maxElementCount) {
|
||||||
Clay__currentContext->maxElementCount = maxElementCount;
|
Clay_Context* context = Clay_GetCurrentContext();
|
||||||
|
context->maxElementCount = maxElementCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
CLAY_WASM_EXPORT("Clay_GetMaxMeasureTextCacheWordCount")
|
||||||
|
int32_t Clay_GetMaxMeasureTextCacheWordCount(void) {
|
||||||
|
Clay_Context* context = Clay_GetCurrentContext();
|
||||||
|
return context->maxMeasureTextCacheWordCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
CLAY_WASM_EXPORT("Clay_SetMaxMeasureTextCacheWordCount")
|
CLAY_WASM_EXPORT("Clay_SetMaxMeasureTextCacheWordCount")
|
||||||
|
@ -208,10 +208,10 @@ void HandleClayErrors(Clay_ErrorData errorData) {
|
|||||||
printf("%s", errorData.errorText.chars);
|
printf("%s", errorData.errorText.chars);
|
||||||
if (errorData.errorType == CLAY_ERROR_TYPE_ELEMENTS_CAPACITY_EXCEEDED) {
|
if (errorData.errorType == CLAY_ERROR_TYPE_ELEMENTS_CAPACITY_EXCEEDED) {
|
||||||
reinitializeClay = true;
|
reinitializeClay = true;
|
||||||
// Clay_SetMaxElementCount(Clay_SetMaxElementCount() * 2);
|
Clay_SetMaxElementCount(Clay_GetMaxElementCount() * 2);
|
||||||
} else if (errorData.errorType == CLAY_ERROR_TYPE_TEXT_MEASUREMENT_CAPACITY_EXCEEDED) {
|
} else if (errorData.errorType == CLAY_ERROR_TYPE_TEXT_MEASUREMENT_CAPACITY_EXCEEDED) {
|
||||||
reinitializeClay = true;
|
reinitializeClay = true;
|
||||||
// Clay_SetMaxMeasureTextCacheWordCount(Clay__maxMeasureTextCacheWordCount * 2);
|
Clay_SetMaxMeasureTextCacheWordCount(Clay_GetMaxMeasureTextCacheWordCount() * 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user