Fix inverted condition for setting booleanWarnings.maxTextMeasureCacheExceeded

This commit is contained in:
mizmar 2025-02-18 10:10:17 +01:00 committed by GitHub
parent a60b977946
commit 26ae5d90e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

2
clay.h
View File

@ -1443,7 +1443,7 @@ Clay__MeasureTextCacheItem *Clay__MeasureTextCached(Clay_String *text, Clay_Text
measured = Clay__MeasureTextCacheItemArray_Get(&context->measureTextHashMapInternal, newItemIndex);
} else {
if (context->measureTextHashMapInternal.length == context->measureTextHashMapInternal.capacity - 1) {
if (context->booleanWarnings.maxTextMeasureCacheExceeded) {
if (!context->booleanWarnings.maxTextMeasureCacheExceeded) {
context->errorHandler.errorHandlerFunction(CLAY__INIT(Clay_ErrorData) {
.errorType = CLAY_ERROR_TYPE_ELEMENTS_CAPACITY_EXCEEDED,
.errorText = CLAY_STRING("Clay ran out of capacity while attempting to measure text elements. Try using Clay_SetMaxElementCount() with a higher value."),