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 and nicbarker committed Jan 14, 2025
1 parent ee8ee0a commit 8668534
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 @@ -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) {
Expand Down

0 comments on commit 8668534

Please sign in to comment.