]> git.lyx.org Git - features.git/commitdiff
Correct painting of a fully selected tabular cell.
authorVincent van Ravesteijn <vfr@lyx.org>
Tue, 18 Nov 2008 22:35:02 +0000 (22:35 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Tue, 18 Nov 2008 22:35:02 +0000 (22:35 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27630 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetTabular.cpp

index 7583cabb38a4a23f2b4d8c6d637c134df9586009..2d0d4d0730719e20ba65b785b5a91f731424ded3 100644 (file)
@@ -3104,8 +3104,10 @@ void InsetTabular::drawSelection(PainterInfo & pi, int x, int y) const
 
        //resetPos(cur);
 
+       bool const full_cell_selected = isCellSelected(cur,
+               tabular.cellRow(cur.idx()), tabular.cellColumn(cur.idx()));
 
-       if (cur.selIsMultiCell()) {
+       if (cur.selIsMultiCell() || full_cell_selected) {
                y -= tabular.rowAscent(0);
                for (row_type j = 0; j < tabular.row_info.size(); ++j) {
                        int const a = tabular.rowAscent(j);
@@ -3119,8 +3121,7 @@ void InsetTabular::drawSelection(PainterInfo & pi, int x, int y) const
                                        tabular.cellIndex(j, i);
                                int const w = tabular.columnWidth(cell);
                                if (isCellSelected(cur, j, i))
-                                       pi.pain.fillRectangle(xx, y, w, h,
-                                                             Color_selection);
+                                       pi.pain.fillRectangle(xx, y, w, h, Color_selection);
                                xx += w;
                        }
                        y += h;