There's a bug in your logic here that means you won't render the last line of text.
You add the text to the 'wrappedLines' everytime the string goes over the edge, but the last line doesn't get added so won't get drawn.
Need a simple, 'wrappedLines.Add(line);' after the foreach loop.
Also FYI for people reading, I'm sure you'll be aware, but ideally you want this logic calculating once in a different location than during the actual render - otherwise it could get expensive to continuously measure the lines to calculate the word wrap and do this again and again even though it keeps working it out the same.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
There's a bug in your logic here that means you won't render the last line of text.
You add the text to the 'wrappedLines' everytime the string goes over the edge, but the last line doesn't get added so won't get drawn.
Need a simple, 'wrappedLines.Add(line);' after the foreach loop.
Also FYI for people reading, I'm sure you'll be aware, but ideally you want this logic calculating once in a different location than during the actual render - otherwise it could get expensive to continuously measure the lines to calculate the word wrap and do this again and again even though it keeps working it out the same.