commit 8b8da975009230ef775784ca4d21dae776dfc53f
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Wed Apr 23 14:50:17 2025 +0200

    Fixup 33442b17: empty row before math hull should not forbid inline inset.
    
    Normally, text insets can be inline only when their content is on one
    row. In the case of display hull inset, there can be an empty top row
    inserted before since commit 33442b17.
    
    This takes this case into account.
---
 src/TextMetrics.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp
index aabe2bcedb..56a750587d 100644
--- a/src/TextMetrics.cpp
+++ b/src/TextMetrics.cpp
@@ -588,10 +588,13 @@ bool TextMetrics::redoParagraph(pit_type const pit, bool 
const align_rows)
        /* If there is more than one row, expand the text to the full
         * allowable width. This setting here is needed for the
         * setRowAlignment() below. We do nothing when tight insets are
-        * requested.
+        * requested or when the first row of two is empty due to
+        * AlwaysBreakBefore flag.
         */
-       if (pm.rows().size() > 1 && !tight_ && dim_.wid < max_width_)
-                       dim_.wid = max_width_;
+       if (!tight_ && dim_.wid < max_width_
+           && (pm.rows().size() > 2
+               || (pm.rows().size() == 2 && !pm.rows().front().empty())))
+               dim_.wid = max_width_;
 
        // Compute height and alignment of the rows.
        for (Row & row : pm.rows()) {
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to