Make text insets wide as soon as they contain a display inset

This also handles the case of a paragraph ended by a newline.

Fixes bug #9757.
This commit is contained in:
Jean-Marc Lasgouttes 2015-09-14 20:57:11 +02:00
parent 8b89709fc9
commit cdb9f04395

View File

@ -443,10 +443,11 @@ bool TextMetrics::redoParagraph(pit_type const pit)
breakRow(row, right_margin, pit); breakRow(row, right_margin, pit);
setRowHeight(row, pit); setRowHeight(row, pit);
row.setChanged(false); row.setChanged(false);
if (row_index || row.endpos() < par.size()) if (row_index || row.right_boundary() || row.endpos() < par.size())
// If there is more than one row, expand the text to // If there is more than one row or the row has been
// the full allowable width. This setting here is needed // broken by a display inset or a newline, expand the text
// for the computeRowMetrics() below. // to the full allowable width. This setting here is
// needed for the computeRowMetrics() below.
dim_.wid = max_width_; dim_.wid = max_width_;
int const max_row_width = max(dim_.wid, row.width()); int const max_row_width = max(dim_.wid, row.width());
computeRowMetrics(pit, row, max_row_width); computeRowMetrics(pit, row, max_row_width);