commit 4a5512552a5e047f574464bd38c6862da9cfbce4
Author: Juergen Spitzmueller <[email protected]>
Date:   Tue Oct 21 20:30:32 2025 +0200

    Fix wrong drawing of cell color with varwidth cells
---
 src/insets/InsetTabular.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index 3bebef5bf2..14f2e4b557 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -2252,6 +2252,7 @@ void Tabular::read(Lexer & lex)
                                return;
                        }
                        cell_info[i][j].inset->toggleCaptionRow(is_long_tabular 
&& row_info[i].caption);
+                       
cell_info[i][j].inset->toggleVarWidth(column_info[j].varwidth);
                        getTokenValue(line, "multicolumn", 
cell_info[i][j].multicolumn);
                        getTokenValue(line, "multirow", 
cell_info[i][j].multirow);
                        getTokenValue(line, "mroffset", 
cell_info[i][j].mroffset);
@@ -4970,7 +4971,8 @@ void InsetTableCell::draw(PainterInfo & pi, int x, int y) 
const
        int const w = width;
        int const h = mr_rows * (tm.height() + 2 * topOffset(pi.base.bv) + 
bottomOffset(pi.base.bv) + Painter::thin_line);
        int const yframe = y - mr_rows * (tm.ascent()) - mr_rows * 
(Painter::thin_line) - topOffset(pi.base.bv);
-       int const xframe = x - (w - tm.width()) / 2 + leftOffset(pi.base.bv);
+       int const xframe = (isVarwidth) ? x : x - (w - tm.width()) / 2 + 
leftOffset(pi.base.bv);
+
        if (pi.full_repaint)
                pi.pain.fillRectangle(xframe, yframe, w, h,
                        pi.backgroundColor(this));
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to