increment in the same way in ::draw, ::drawSelection and ::cursorPos

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33733 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Edwin Leuven 2010-03-13 12:00:37 +00:00
parent 9be4767f27
commit b5ddcaa4d1

View File

@ -3314,8 +3314,8 @@ void InsetTabular::draw(PainterInfo & pi, int x, int y) const
} }
if (r + 1 < tabular.nrows()) if (r + 1 < tabular.nrows())
y += tabular.rowDescent(r) + tabular.rowAscent(r + 1) y += tabular.rowDescent(r) + tabular.rowAscent(r + 1)
+ tabular.interRowSpace(r + 1); + tabular.interRowSpace(r + 1);
} }
} }
@ -3347,7 +3347,6 @@ void InsetTabular::drawSelection(PainterInfo & pi, int x, int y) const
tabular.cellRow(cur.idx()), tabular.cellColumn(cur.idx())); tabular.cellRow(cur.idx()), tabular.cellColumn(cur.idx()));
if (cur.selIsMultiCell() || full_cell_selected) { if (cur.selIsMultiCell() || full_cell_selected) {
y -= tabular.rowAscent(0);
for (row_type r = 0; r < tabular.nrows(); ++r) { for (row_type r = 0; r < tabular.nrows(); ++r) {
int xx = x; int xx = x;
for (col_type c = 0; c < tabular.ncols(); ++c) { for (col_type c = 0; c < tabular.ncols(); ++c) {
@ -3362,12 +3361,13 @@ void InsetTabular::drawSelection(PainterInfo & pi, int x, int y) const
} }
int const w = tabular.columnWidth(cell); int const w = tabular.columnWidth(cell);
int const h = tabular.rowHeight(cell); int const h = tabular.rowHeight(cell);
int const yy = y - tabular.rowAscent(r);
if (isCellSelected(cur, r, c)) if (isCellSelected(cur, r, c))
pi.pain.fillRectangle(xx, y, w, h, Color_selection); pi.pain.fillRectangle(xx, yy, w, h, Color_selection);
xx += w; xx += w;
} }
if (r + 1 < tabular.nrows()) if (r + 1 < tabular.nrows())
y += tabular.rowDescent(r) + tabular.rowAscent(r) y += tabular.rowDescent(r) + tabular.rowAscent(r + 1)
+ tabular.interRowSpace(r + 1); + tabular.interRowSpace(r + 1);
} }
@ -4434,10 +4434,10 @@ void InsetTabular::cursorPos(BufferView const & bv,
int const col = tabular.cellColumn(sl.idx()); int const col = tabular.cellColumn(sl.idx());
// y offset correction // y offset correction
for (int r = 0; r < row; ++r) { for (int r = 0; r < row; ++r)
y += tabular.rowAscent(r + 1) + tabular.rowDescent(r) y += tabular.rowDescent(r) + tabular.rowAscent(r + 1)
+ tabular.interRowSpace(r + 1); + tabular.interRowSpace(r + 1);
}
y += tabular.textVOffset(sl.idx()); y += tabular.textVOffset(sl.idx());
// x offset correction // x offset correction