Bug fix for words that overflow their containers

This commit is contained in:
Nic Barker 2024-11-30 21:05:19 +13:00
parent fd53b0a1bd
commit 70b9f6f8f6

1
clay.h
View File

@ -2246,6 +2246,7 @@ void Clay__CalculateFinalLayout() {
if (lineLengthChars == 0 && lineWidth + measuredWord->width > containerElement->dimensions.width) {
Clay__StringArray_Add(&Clay__wrappedTextLines, CLAY__INIT(Clay_String) {.length = (int)measuredWord->length, .chars = &textElementData->text.chars[measuredWord->startOffset] });
textElementData->wrappedLines.length++;
wordIndex = measuredWord->next;
}
// measuredWord->length == 0 means a newline character
else if (measuredWord->length == 0 || lineWidth + measuredWord->width > containerElement->dimensions.width) {