mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 12:58:33 +01:00
Fixed TokenizedString handling trailing spaces incorrectly in the last line of non-left aligned text
This commit is contained in:
parent
32dad847a0
commit
0fe4c940d7
2 changed files with 4 additions and 1 deletions
|
@ -19,6 +19,9 @@ Improvements
|
||||||
- Improved EnumHelper.GetValues signature to return an array
|
- Improved EnumHelper.GetValues signature to return an array
|
||||||
- Allow using external gesture handling alongside InputHandler through ExternalGestureHandling
|
- Allow using external gesture handling alongside InputHandler through ExternalGestureHandling
|
||||||
|
|
||||||
|
Fixes
|
||||||
|
- Fixed TokenizedString handling trailing spaces incorrectly in the last line of non-left aligned text
|
||||||
|
|
||||||
### MLEM.Ui
|
### MLEM.Ui
|
||||||
Additions
|
Additions
|
||||||
- Added some extension methods for querying Anchor types
|
- Added some extension methods for querying Anchor types
|
||||||
|
|
|
@ -223,7 +223,7 @@ namespace MLEM.Formatting {
|
||||||
var token = this.Tokens[tokenIndex];
|
var token = this.Tokens[tokenIndex];
|
||||||
var tokenFont = token.GetFont(defaultFont);
|
var tokenFont = token.GetFont(defaultFont);
|
||||||
// if we're the last line in our line array, then we don't contain a line split, so the line ends in a later token
|
// if we're the last line in our line array, then we don't contain a line split, so the line ends in a later token
|
||||||
var endsLater = lineIndex >= token.SplitDisplayString.Length - 1;
|
var endsLater = lineIndex >= token.SplitDisplayString.Length - 1 && tokenIndex < this.Tokens.Length - 1;
|
||||||
// if the line ends in our token, we should ignore trailing white space
|
// if the line ends in our token, we should ignore trailing white space
|
||||||
var restOfLine = tokenFont.MeasureString(token.SplitDisplayString[lineIndex], !endsLater).X;
|
var restOfLine = tokenFont.MeasureString(token.SplitDisplayString[lineIndex], !endsLater).X;
|
||||||
if (endsLater) {
|
if (endsLater) {
|
||||||
|
|
Loading…
Reference in a new issue