-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Core] CLAY_TEXT not rendering lines that contain single characters #188
Comments
Hello 👋 Clay_TextElementConfig textElement = {.fontId = FONT_ID_BODY_24, .textColor = {255, 255, 255, 255}, .fontSize = 64};
CLAY(CLAY_LAYOUT(layoutElement1)) {
CLAY_TEXT(CLAY_STRING("Hello\nWorld\nI\nCode\n"), CLAY_TEXT_CONFIG(textElement));
} |
Thanks, still wrapping my head around the syntax, problems still occurs however. I updated the issue description with the correct syntax |
@Ryzee119 that's totally fine! The syntax is a little odd at the moment for sure, we have plans to improve it 🙂 |
Is it alright if I close this issue? |
You can, but the issue is still present with the correct syntax too |
Line 1707 in 208c7cb
Changing this to I think it appears to work on some scales due to another quirk/bug in the string slices. At some font scaling CLAY_RENDER_COMMAND_TYPE_TEXT is (correctly?) receiving strings broken up by spaces and new lines, however other times it just sends to entire string in one block. This was hiding the bug. |
@Ryzee119 very nice work finding it! |
That bug you've described certainly looks very suspicious though, I will dig into the issues at different font sizes. |
Ive found this issue. If a line that contains new line characters is shorter than the container size it just pushes it to the render without parsing the new lines. This is bailing too early. Ill raise a new issue Lines 2370 to 2374 in 208c7cb
|
Yep I've found it too, already fixing it 😁 |
Tentative fix is here: #192 |
Seems somehow related to fontSize and how it scales?
Im using the raylib rendering backend
however changing to
fontSize = 32
(for example) appears to fix itThe text was updated successfully, but these errors were encountered: