Initialize text measurement hashmap (#25)

This commit is contained in:
Bach Le 2024-09-25 09:30:36 +08:00 committed by GitHub
parent 52b3f6a14e
commit c60fb1300f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

3
clay.h
View File

@ -3125,6 +3125,9 @@ void Clay_Initialize(Clay_Arena arena, Clay_Dimensions layoutDimensions) {
for (int i = 0; i < Clay__layoutElementsHashMap.capacity; ++i) { for (int i = 0; i < Clay__layoutElementsHashMap.capacity; ++i) {
Clay__layoutElementsHashMap.internalArray[i] = -1; Clay__layoutElementsHashMap.internalArray[i] = -1;
} }
for (int i = 0; i < Clay__measureTextHashMap.capacity; ++i) {
Clay__measureTextHashMap.internalArray[i] = 0;
}
Clay__measureTextHashMapInternal.length = 1; // Reserve the 0 value to mean "no next element" Clay__measureTextHashMapInternal.length = 1; // Reserve the 0 value to mean "no next element"
Clay__layoutDimensions = layoutDimensions; Clay__layoutDimensions = layoutDimensions;
} }