Fix TextEdit HScroll hiding after wrapping #92271
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.
Since it only happens in certain scenarios here is more information and reproduction steps:
Reproduction:
TextEdit
width such that the wordprevious
will be wrapped but not the wordtime.
from the comments on lines 9 and 4.When disabling word wrap, the longest line while wrapped (line 4) doesn't change size so
TextEdit::Text::_calculate_line_height()
exits early, even though there is a new longest line.This happens because
TextEdit::Text::_calculate_max_line_width()
was assuming it was being called fromTextEdit::Text::invalidate_cache()
only and that lines had only shrunk, but this is not true since it can be called fromTextEdit::Text::invalidate_all_lines()
and other places.This also applies to
TextEdit::Text::_calculate_line_height()
since it is the same situation.