mirror of
https://github.com/nicbarker/clay.git
synced 2025-01-23 01:46:02 +00:00
fix #99 - [Core] Bug in text wrapping at very narrow widths (#163)
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Waiting to run
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Failing after 1m36s
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Failing after 16s
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Waiting to run
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Failing after 1m36s
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Failing after 16s
This commit is contained in:
parent
723f59dffd
commit
6cb9c7c483
1
clay.h
1
clay.h
@ -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] } });
|
Clay__WrappedTextLineArray_Add(&Clay__wrappedTextLines, CLAY__INIT(Clay__WrappedTextLine) { { measuredWord->width, lineHeight }, { .length = measuredWord->length, .chars = &textElementData->text.chars[measuredWord->startOffset] } });
|
||||||
textElementData->wrappedLines.length++;
|
textElementData->wrappedLines.length++;
|
||||||
wordIndex = measuredWord->next;
|
wordIndex = measuredWord->next;
|
||||||
|
lineStartOffset = measuredWord->startOffset + measuredWord->length;
|
||||||
}
|
}
|
||||||
// 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