Skip to content

Conversation

SzieberthAdam
Copy link
Contributor

Hello! I copied the DrawTextBoxed() code into my project and noticed this glitch. Wrapped spaces are currently moved into the start of the next line. Hence this PR. Cheers!

}

textOffsetX += glyphWidth;
if ((textOffsetX != 0) || (codepoint != ' ')) textOffsetX += glyphWidth; // avoid leading spaces
Copy link
Owner

Choose a reason for hiding this comment

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

Not sure if I understand the improvement, (codepoint == ' ') glyph width must be considered when calculating textOffsetX.

@SzieberthAdam
Copy link
Contributor Author

Sorry for not writing it properly. Just shrink the box slowly:
raylib-example-pr

@raysan5 raysan5 merged commit 4cca234 into raysan5:master Oct 11, 2022
@raysan5
Copy link
Owner

raysan5 commented Oct 11, 2022

@SzieberthAdam Thanks for the details! Now I understand it better the issue! :)

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