Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RichTextLabel table overlapping with next line #92605

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

aaronp64
Copy link
Contributor

@aaronp64 aaronp64 commented May 31, 2024

When calculating table height, RichTextLabel::_shape_line would increase the height when it reached the end of a complete row, or the final cell of the table. RichTextLabel::_resize_line would only increase the height at the end of a complete row, causing the height to ignore the final row if not all cells were populated. This would cause the final row to overlap with the following line in the RichTextLabel if it was the last visible line in the RichTextLabel, as _resize_line is called when updating scrolling properties.

This change moves the common table size calculations to a separate function to reuse the code between _shape_line and _resize_line, keeping the final cell check that was used in _shape_line.

Fixes #92603

@aaronp64 aaronp64 requested a review from a team as a code owner May 31, 2024 20:02
When calculating table height, RichTextLabel::_shape_line would increase the height when it reached the end of a complete row, or the final cell of the table.  RichTextLabel::_resize_line would only increase the height at the end of a complete row, causing the height to ignore the final row if not all cells were populated.  This would cause the final row to overlap with the following line in the RichTextLabel if it was the last visible line in the RichTextLabel, as _resize_line is called when updating scrolling properties.

This change moves the common table size calculations to a separate function to reuse the code between _shape_line and _resize_line, keeping the final cell check that was used in _shape_line.

Fixes godotengine#92603
@KoBeWi KoBeWi added this to the 4.3 milestone May 31, 2024
@aaronp64 aaronp64 force-pushed the richtextlabel_table_overlap branch from cfda339 to 6ecccd6 Compare May 31, 2024 20:27
@bruvzg bruvzg self-requested a review May 31, 2024 20:45
@akien-mga akien-mga merged commit 353f7bf into godotengine:master Jun 3, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@aaronp64 aaronp64 deleted the richtextlabel_table_overlap branch June 28, 2024 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RichTextLabel with BBCode enabled can show table overlapping with next line
4 participants