Closed whereswaldon closed 1 year ago
Nicely done !
If I understand correctly, WrapParagraph
will return at most WrapAfterLine (unless its zero), right? Maybe that could appear explicitly in the doc?
Nicely done ! If I understand correctly,
WrapParagraph
will return at most WrapAfterLine (unless its zero), right? Maybe that could appear explicitly in the doc?
Done!
Thanks all!
This commit adds a mechanism to limit the number of wrapped lines of text to a fixed quantity. Doing so will currently still require shaping all of the text, but does skip the work to wrap any truncated text.
Updates #28
This does not implement inserting a symbol to indicate truncation, but seemed like a good starting point. Being able to truncate without the symbol is useful on its own, and this way the change is as simple as possible.
I deviated slightly from the discussion in #28 because I realized there are reasons one might wish to only display exactly N lines of text. Instead of a boolean indicating whether or not to truncate, I've used an integer count of lines. I think it's reasonably intuitive, and has the happy side effect of having a zero value which will not perform truncation.
I look forward to your thoughts!