Following rP26889, I noticed a bug with right-alignment of text.
- In ComputeLineSize, we removed a ' ' worth of space when wrapping, because we want to ignore the space between words.
- In AssembleCalls (and the constructor), we didn't, causing long words to sometimes get wrapped to the next line (see below) unexpectedly, breaking the layout.
- But the behaviour in ComputeLineSize is wrong anyways, because there is actually no guarantee that the word-separator is a space.
- And we didn't ignore spaces when not-wrapping, which is also broken for center/right-alignment.
To fix this mess, my proposition is to add some data to the feedback to know is the last bit of a word is a space for alignment purposes.
If yes, ignore that space in all three relevant functions: CGuiText(), ComputeLineSize and AssembleCalls.
The duplication in logic in those functions is annoying but that refactoring is for another day I'm afraid.
Compare SVN & with the fix: