fix an edge case where text could be measured incorrectly

This commit is contained in:
Nic Barker 2024-12-05 13:23:20 +13:00
parent efec6ab1de
commit 0ef877eef7

19
clay.h
View File

@ -1541,8 +1541,23 @@ uint32_t Clay__HashTextWithConfig(Clay_String *text, Clay_TextElementConfig *con
hash += (hash << 10); hash += (hash << 10);
hash ^= (hash >> 6); hash ^= (hash >> 6);
uint64_t configPointerAsNumber = (uint64_t)config; hash += config->fontId;
hash += configPointerAsNumber; hash += (hash << 10);
hash ^= (hash >> 6);
hash += config->fontSize;
hash += (hash << 10);
hash ^= (hash >> 6);
hash += config->lineHeight;
hash += (hash << 10);
hash ^= (hash >> 6);
hash += config->letterSpacing;
hash += (hash << 10);
hash ^= (hash >> 6);
hash += config->wrapMode;
hash += (hash << 10); hash += (hash << 10);
hash ^= (hash >> 6); hash ^= (hash >> 6);