Fix tooltips sometimes having a trailing new line #762
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.
From my understanding, the algorithm that calculated the required width for those tooltips updated the
current_widthvariable before checking if it has enough space to do so, leading to acurrent_width(and alargest_width) larger than thebox_width. So tooltips that had a longer text thanbox_widthhad a chance to fit their text in a single line even though two lines should be required.With that fix,
current_widthis updated after checking that there is enough space.Before:


After:


As as side not, the original Caesar 3 tooltips do not have this issue (but they appear to be a bit more longer?) so I guess this is a Julius issue.