Skip to content

Commit

Permalink
fix #99 - [Core] Bug in text wrapping at very narrow widths (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
bullyingteen authored Jan 5, 2025
1 parent 723f59d commit 6cb9c7c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions clay.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6cb9c7c

Please sign in to comment.