When MaxLines set line breaks should only occur at a character boundary if there is no required (and valid) line break to use.
Additionally this PR opts for line breaking at a character boundary as opposed to a line break position. Since this only occurs on the final line this results in the most amount of characters being fitted before clipping/ellipsing. This allows for mimicking the behavior of System.Drawing.StringTrimming.EllipsisCharacter, but may not be the desired default behavior of this library. This behavior could instead be configured via a flag och TextBlock if desired.
This PR fixes https://github.com/toptensoftware/RichTextKit/issues/65
When
MaxLines
set line breaks should only occur at a character boundary if there is no required (and valid) line break to use.Additionally this PR opts for line breaking at a character boundary as opposed to a line break position. Since this only occurs on the final line this results in the most amount of characters being fitted before clipping/ellipsing. This allows for mimicking the behavior of
System.Drawing.StringTrimming.EllipsisCharacter
, but may not be the desired default behavior of this library. This behavior could instead be configured via a flag ochTextBlock
if desired.