From c60fb1300fa77af031fd57acae52207d1335ccb8 Mon Sep 17 00:00:00 2001 From: Bach Le Date: Wed, 25 Sep 2024 09:30:36 +0800 Subject: [PATCH] Initialize text measurement hashmap (#25) --- clay.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clay.h b/clay.h index 7904235..b098e98 100644 --- a/clay.h +++ b/clay.h @@ -3125,6 +3125,9 @@ void Clay_Initialize(Clay_Arena arena, Clay_Dimensions layoutDimensions) { for (int i = 0; i < Clay__layoutElementsHashMap.capacity; ++i) { 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__layoutDimensions = layoutDimensions; }