Skip to content

Fix WrapString leaving lines wider than the limit - #10613

Open
zubSero wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
zubSero:fix/10590-tooltip-wrap
Open

zubSero wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
zubSero:fix/10590-tooltip-wrap

Conversation

@zubSero

@zubSero zubSero commented Nov 27, 2026

Copy link
Copy Markdown

Fixes #10590.

Description of the problem being solved:

main:WrapString kept the word that pushed a line over the width on that line and only then started a new one, so wrapped tooltip lines could be wider than the limit. The last line was never checked at all.

It now breaks before the word that doesn't fit. For example WrapString("aa bb cc dd", 16, 5) with one unit per character returned {"aa bb cc", "dd"} and now returns {"aa bb", "cc dd"}.

This was part of #10585. I split it out so it can be reviewed on its own.

Steps taken to verify a working solution:

  • Added a test for a line in the middle and for the last line. It fails on dev.

The word that pushed a line over the width stayed on that line, and an overlong last line was never wrapped. The line now breaks before the overflowing word.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tooltip wrapping can leave lines wider than their configured limit

1 participant