mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-20 05:08:04 +00:00
Bug fix for words that overflow their containers
This commit is contained in:
parent
fd53b0a1bd
commit
70b9f6f8f6
1
clay.h
1
clay.h
@ -2246,6 +2246,7 @@ void Clay__CalculateFinalLayout() {
|
|||||||
if (lineLengthChars == 0 && lineWidth + measuredWord->width > containerElement->dimensions.width) {
|
if (lineLengthChars == 0 && lineWidth + measuredWord->width > containerElement->dimensions.width) {
|
||||||
Clay__StringArray_Add(&Clay__wrappedTextLines, CLAY__INIT(Clay_String) {.length = (int)measuredWord->length, .chars = &textElementData->text.chars[measuredWord->startOffset] });
|
Clay__StringArray_Add(&Clay__wrappedTextLines, CLAY__INIT(Clay_String) {.length = (int)measuredWord->length, .chars = &textElementData->text.chars[measuredWord->startOffset] });
|
||||||
textElementData->wrappedLines.length++;
|
textElementData->wrappedLines.length++;
|
||||||
|
wordIndex = measuredWord->next;
|
||||||
}
|
}
|
||||||
// measuredWord->length == 0 means a newline character
|
// measuredWord->length == 0 means a newline character
|
||||||
else if (measuredWord->length == 0 || lineWidth + measuredWord->width > containerElement->dimensions.width) {
|
else if (measuredWord->length == 0 || lineWidth + measuredWord->width > containerElement->dimensions.width) {
|
||||||
|
Loading…
Reference in New Issue
Block a user