Skip to content

Commit 8668534

Browse files
bullyingteennicbarker
authored andcommitted
fix #99 - [Core] Bug in text wrapping at very narrow widths (#163)
1 parent ee8ee0a commit 8668534

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clay.h

+1
Original file line numberDiff line numberDiff line change
@@ -2399,6 +2399,7 @@ void Clay__CalculateFinalLayout(void) {
23992399
Clay__WrappedTextLineArray_Add(&Clay__wrappedTextLines, CLAY__INIT(Clay__WrappedTextLine) { { measuredWord->width, lineHeight }, { .length = measuredWord->length, .chars = &textElementData->text.chars[measuredWord->startOffset] } });
24002400
textElementData->wrappedLines.length++;
24012401
wordIndex = measuredWord->next;
2402+
lineStartOffset = measuredWord->startOffset + measuredWord->length;
24022403
}
24032404
// measuredWord->length == 0 means a newline character
24042405
else if (measuredWord->length == 0 || lineWidth + measuredWord->width > containerElement->dimensions.width) {

0 commit comments

Comments
 (0)