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

RichTextLabel with BBCode enabled can show table overlapping with next line #92603

Closed
aaronp64 opened this issue May 31, 2024 · 0 comments · Fixed by #92605
Closed

RichTextLabel with BBCode enabled can show table overlapping with next line #92603

aaronp64 opened this issue May 31, 2024 · 0 comments · Fixed by #92605
Milestone

Comments

@aaronp64
Copy link
Contributor

Tested versions

v4.3.beta.custom_build [705b7a0]

System information

Windows 10

Issue description

When a RichTextLabel has BBCode enabled, and contains a table that ends on the last visible line, the table will overlap with the next line following it if not all cells are populated in the last row. Similar issue to #47012, but only happens on the last visible line.

Steps to reproduce

In a new project, add a RichTextLabel to the main scene, enable BBCode, and add the following text:

Top text
[table=3]
[cell]Cell[/cell]
[cell]Cell[/cell]
[cell]Cell[/cell]
[cell]Cell[/cell]
[cell]Cell[/cell]
[cell]Cell[/cell]
[cell]Cell[/cell]
[/table]
Bottom Text

Adjust RichTextLabel size and number of cells as needed to line up table with bottom of the RichTextLabel. Enabling "Fit Content" is an quick way to line up the size, but not required to see the issue.

Minimal reproduction project (MRP)

N/A, can be reproduced in a new project with the steps above

@akien-mga akien-mga added this to the 4.3 milestone Jun 3, 2024
MewPurPur pushed a commit to MewPurPur/godot that referenced this issue Jul 11, 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 godotengine#92603
2nafish117 pushed a commit to 2nafish117/godot that referenced this issue Aug 5, 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 godotengine#92603
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants