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

Fixes the right and center alignment bug of rich text label #39164

Merged
merged 1 commit into from
Jun 3, 2020

Conversation

theoway
Copy link
Contributor

@theoway theoway commented May 30, 2020

Fixes #38846
Bug:- [right] and [center] alignment tags of BBCode in RichTextLabel were not aligning properly like they were supposed to, and the text would overlap when the label was resized.
Reason:- Offset cache of the lines was not getting updated.

I've used center alignment for demonstration.
Before the fix:-
Godot Engine - RichTextLabel Overlap Bug - Main Scene tscn (_) 2020-05-30 14-10-31

After the fix:-
Godot Engine - RichTextLabel Overlap Bug - Main Scene tscn (_) 2020-05-30 14-06-08_Trim

@Calinou Calinou added this to the 4.0 milestone May 30, 2020
@Calinou Calinou added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label May 30, 2020
@pouleyKetchoupp
Copy link
Contributor

Great job!

This PR also fixes #34308.

I've tested different cases with left/center/right align, some images and different fonts and everything works fine so far.

@theoway
Copy link
Contributor Author

theoway commented May 30, 2020

Great job!

This PR also fixes #34308.

I've tested different cases with left/center/right align, some images and different fonts and everything works fine so far.

Thanks for running the tests.

@theoway theoway force-pushed the richlabeltext_align_bug branch 2 times, most recently from bddb0a8 to a7d2d6e Compare May 30, 2020 19:20
@theoway theoway requested a review from akien-mga May 31, 2020 08:21
@theoway theoway force-pushed the richlabeltext_align_bug branch from a7d2d6e to b2a32d0 Compare June 3, 2020 16:03
@akien-mga akien-mga merged commit 7c3dc85 into godotengine:master Jun 3, 2020
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.2.2.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jun 4, 2020
@theoway theoway deleted the richlabeltext_align_bug branch June 8, 2020 17:13
pouleyKetchoupp added a commit to nekomatata/godot that referenced this pull request Jul 3, 2020
Fixes godotengine#40068 (regression from godotengine#39164) by not applying the line offset
change in the case of fill alignment mode.
akien-mga pushed a commit to akien-mga/godot that referenced this pull request Jul 3, 2020
Fixes godotengine#40068 (regression from godotengine#39164) by not applying the line offset
change in the case of fill alignment mode.

(cherry picked from commit 44f8899)
pouleyKetchoupp added a commit to nekomatata/godot that referenced this pull request Sep 11, 2020
Fixes godotengine#41006 (regression from godotengine#39164).

The original alignment fix was limited to PROCESS_DRAW mode, which
caused some discrepancies with PROCESS_POINTER mode.
Now only PROCESS_CACHE is excluded with a condition a few lines above.
akien-mga pushed a commit that referenced this pull request Sep 11, 2020
Fixes #41006 (regression from #39164).

The original alignment fix was limited to PROCESS_DRAW mode, which
caused some discrepancies with PROCESS_POINTER mode.
Now only PROCESS_CACHE is excluded with a condition a few lines above.

(cherry picked from commit b783fa1)
MarcusElg pushed a commit to MarcusElg/godot that referenced this pull request Oct 19, 2020
Fixes godotengine#40068 (regression from godotengine#39164) by not applying the line offset
change in the case of fill alignment mode.
MarcusElg pushed a commit to MarcusElg/godot that referenced this pull request Oct 19, 2020
Fixes godotengine#41006 (regression from godotengine#39164).

The original alignment fix was limited to PROCESS_DRAW mode, which
caused some discrepancies with PROCESS_POINTER mode.
Now only PROCESS_CACHE is excluded with a condition a few lines above.
huhund pushed a commit to huhund/godot that referenced this pull request Nov 10, 2020
Fixes godotengine#40068 (regression from godotengine#39164) by not applying the line offset
change in the case of fill alignment mode.

(cherry picked from commit 44f8899)
huhund pushed a commit to huhund/godot that referenced this pull request Nov 10, 2020
Fixes godotengine#41006 (regression from godotengine#39164).

The original alignment fix was limited to PROCESS_DRAW mode, which
caused some discrepancies with PROCESS_POINTER mode.
Now only PROCESS_CACHE is excluded with a condition a few lines above.

(cherry picked from commit b783fa1)
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.

[center] and [right] bbcode align tags in RichTextLabel causes text to overlap itself
4 participants