Skip to content

Conversation

@SogoCZE
Copy link
Contributor

@SogoCZE SogoCZE commented Oct 4, 2024

Wrap mode NEWLINES was skipped all the time because of this if condition:

// Short circuit all wrap calculations if wrap mode is none
if (textConfig->wrapMode == CLAY_TEXT_WRAP_NONE || (containerElement->dimensions.width == textElementData->preferredDimensions.width)) {

The second part of the if was always true for text with wrapping mode NEWLINES. I added another condition that skips this width check in the case of NEWLINES.

Automatic word wrapping (works fine):
image

Manual line breaks (\n) before the fix:
image

Manual line breaks (\n) after the fix:
image

Copy link
Owner

@nicbarker nicbarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it out and looks good to me!

@nicbarker nicbarker merged commit c02db35 into nicbarker:main Oct 4, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants