Skip to content

Fix RichText height calculation for mixed fonts and inline controls#6393

Open
chavonadelal wants to merge 2 commits intospace-wizards:masterfrom
chavonadelal:RichTextEntry
Open

Fix RichText height calculation for mixed fonts and inline controls#6393
chavonadelal wants to merge 2 commits intospace-wizards:masterfrom
chavonadelal:RichTextEntry

Conversation

@chavonadelal
Copy link

Problem

The height of rich text was calculated only based on the current font and increased only when lines were wrapped. Because of this, lines with different font sizes or inline controls could have a reduced height, and the last line could be ignored altogether. Surprisingly, this error occurred periodically rather than constantly.

image

Fix

The height calculation has been changed to a “per actual line content” model: for each line, the maximum height of elements (font/inline controls) is accumulated. The line height is added once during wrapping and is guaranteed to be taken into account for the last line. This makes Height correct for rendering.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant