Fix item description rendering issues #7683
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #7651
The initial issue in the unique item info box was caused by
GetLineStartX
returning a negative value for long strings.Fixing that made the text fit but the renderer wraps text at arbitrary points, so we further use
WordWrapString
to break at word boundaries:The info box issue was caused by
KerningFitSpacing
only taking the first line into account.This PR fixes that by recalculating the kerning fit on each new line:
An alternative fix to would be to add a version of
GetLineWidth
that calculates the maximum width across all lines. This would make the kerning the same for all lines.I went with kerning fit per line here but I don't have a strong preference either way.
/cc @Riccila