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

Correct next-line calculation for RichTextEdit #17144

Closed
wants to merge 1 commit into from

Conversation

hpvb
Copy link
Member

@hpvb hpvb commented Mar 1, 2018

It appears that after 77b1320 the line height of the first line in a
RichTextEdit is no longer correctly calculated compared to the following
lines. By subtracting the line_descent from the next y base coordinate
of the next line we get the correct result.

Comparisons:
3.0-stable
screenshot from 2018-03-01 17-55-36
3.0.1-stable
screenshot from 2018-03-01 17-56-01
This pr:
screenshot from 2018-03-01 17-56-24

And with multiple font sizes:
3.0-stable
screenshot from 2018-03-01 17-57-19
3.0.1-stable
screenshot from 2018-03-01 17-57-46
This pr:
screenshot from 2018-03-01 17-58-07

I believe this fixes #17139

It appears that after 77b1320 the line height of the first line in a
RichTextEdit is no longer correctly calculated compared to the following
lines. By subtracting the line_descent from the next y base coordinate
of the next line we get the correct result.
@akien-mga
Copy link
Member

CC @poke1024 for review.

@volzhs
Copy link
Contributor

volzhs commented Mar 1, 2018

it looks good to make correct baseline on the same line with different font size
but 3.0 stable looks better for other lines, less gap between lines.

@hpvb
Copy link
Member Author

hpvb commented Mar 1, 2018

I think #17145 is the correct fix. I'm closing this PR.

@hpvb hpvb closed this Mar 1, 2018
@hpvb hpvb added archived and removed cherrypick labels Mar 1, 2018
@hpvb hpvb removed the cherrypick label Mar 1, 2018
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 has a larger gap between the first and second line compared to the rest.
3 participants