]> git.lyx.org Git - features.git/commitdiff
Make text insets wide as soon as they contain a display inset
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 14 Sep 2015 18:57:11 +0000 (20:57 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 21 Sep 2015 15:53:52 +0000 (17:53 +0200)
This also handles the case of a paragraph ended by a newline.

Fixes bug #9757.

src/TextMetrics.cpp

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