Closed gresolio closed 2 years ago
Thanks for the explanation. I have added EllipsisEnabled
to TextBlock
, now it should cover all the cases: af2e30f.
Is this af2e30f good enough? Or do you have other suggestions for improvement?
Thanks for that.. it looks good I think. I'll do some testing and merge it asap (but I have a couple of busy days ahead so bear with me).
Thanks for this however it doesn't cover all cases.
The case you've handled is where a rich string is truncated exactly on a paragraph boundary. It also needs to handle the case where the truncation happens mid paragraph. Take a look at
CheckHeightConstraints
inTextBlock.cs
for where it does this.https://github.com/toptensoftware/RichTextKit/blob/master/Topten.RichTextKit/TextBlock.cs#L1978
To explain... a
TextBlock
is a single laid out paragraph. A RichString is a list of TextBlocks. When a height constraint is hit such that a previous paragraph fits, but the first line of the next paragraph doesn't, RichString goes back an appends the ellipsis to the prior paragraph. When a paragraph crosses a height constraint it creates the ellipsis itself.