fix #99 - [Core] Bug in text wrapping at very narrow widths

This commit is contained in:
Vincent van Ecchi 2025-01-04 12:14:41 +01:00
parent bcb555fd10
commit fbd8cd50f9
No known key found for this signature in database
GPG Key ID: 229C34B19FCA4545

1
clay.h
View File

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