This repository has been archived by the owner on Dec 2, 2019. It is now read-only.
Adding support for newlines in strings to nk_text/nk_label and family. #661
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The new behavior is as follows:
One line of text will be rendered, up to the first newline
Multiple lines of text will be rendered, wrapping when horizontal space
is exhausted (as normal), but also when a newline is reached.
Multiple lines of text will be rendered, wrapping only when a newline is reached.
This PR adds va_list functions, so it includes my pr_valist pull request (#660). If you don't want to merge pr_valist, I can provide a version without the va_list functions.
This PR should fix #532, though it does introduce a slight breaking change to nk_text and nk_text_wrap: Before those functions would render newline characters as ? symbols, and ignore them. In particular, nk_text would take entire paragraphs of text and render them on one line. Now it only renders the first line of text, and nk_text_wrap manually breaks on newlines. Since this behavior was probably undesirable, I doubt anyone is depending on it. The external behavior of these functions doesn't change, just they way they render things.