Summary:
- Performance of
WrapText
was increased (about 1/2 allocations, and 1/3 execution time), and more unit tests were added forWrapText
. - Added
LineSplitEnumerator
, andSpaceSplitEnumerator
, from https://www.meziantou.net/split-a-string-into-lines-without-allocation.htm, to support newWrapText
method; they'republic
, in case you happen to want to use them, yourself.
Context:
Calling WrapText
every frame isn't a great idea. If you're wrapping a couple short strings, it's probably fine, but it's better to pre-wrap any text you want to render.
That said, PlayPlayMini has convenience methods that, when used, may result in calling WrapText
every frame, so this update makes doing so less-bad.