Fixed broken text NEWLINES wrap mode

This commit is contained in:
Patrik Smělý 2024-10-04 03:04:42 +02:00
parent 9f291ab017
commit d219b9fac5

2
clay.h
View File

@ -1968,7 +1968,7 @@ void Clay__CalculateFinalLayout() {
.length = 0, .length = 0,
}; };
// Short circuit all wrap calculations if wrap mode is none // Short circuit all wrap calculations if wrap mode is none
if (textConfig->wrapMode == CLAY_TEXT_WRAP_NONE || (containerElement->dimensions.width == textElementData->preferredDimensions.width)) { if (textConfig->wrapMode == CLAY_TEXT_WRAP_NONE || (containerElement->dimensions.width == textElementData->preferredDimensions.width && textConfig->wrapMode != CLAY_TEXT_WRAP_NEWLINES)) {
Clay_LayoutElementArray_Add(&Clay__layoutElements, CLAY__INIT(Clay_LayoutElement) { Clay_LayoutElementArray_Add(&Clay__layoutElements, CLAY__INIT(Clay_LayoutElement) {
.text = text, .text = text,
.dimensions = textElementData->preferredDimensions, .dimensions = textElementData->preferredDimensions,