Fix for measured width of richtext strings not including paragraph margins

This commit is contained in:
Brad Robinson 2022-09-27 11:17:53 +10:00
Родитель 05480108b0
Коммит be6dc264c6
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -817,8 +817,9 @@ namespace Topten.RichTextKit
// If this paragraph wasn't completely truncated, then update the measured width
if (!p.Truncated)
{
if (p.TextBlock.MeasuredWidth > _measuredWidth)
_measuredWidth = p.TextBlock.MeasuredWidth;
var paraWidth = p.TextBlock.MeasuredWidth + p.MarginLeft + p.MarginRight;
if (paraWidth > _measuredWidth)
_measuredWidth = paraWidth;
}
// Store the this paragraph as the previous so a fully truncated subsequent