[Bug] Fix NEWLINES wrap mode not being respected correctly (#36)

This commit is contained in:
Patrik Smělý 2024-10-04 03:30:49 +02:00 committed by GitHub
parent 2cf212e992
commit c02db35554
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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,