From 866853443f6e051e3ceacef1f85708a2950d9db9 Mon Sep 17 00:00:00 2001 From: vince Date: Sun, 5 Jan 2025 02:34:36 +0100 Subject: [PATCH] fix #99 - [Core] Bug in text wrapping at very narrow widths (#163) --- clay.h | 1 + 1 file changed, 1 insertion(+) diff --git a/clay.h b/clay.h index 9137f22..8622766 100644 --- a/clay.h +++ b/clay.h @@ -2399,6 +2399,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) {