From: Edwin Leuven Date: Sat, 13 Mar 2010 12:00:37 +0000 (+0000) Subject: increment in the same way in ::draw, ::drawSelection and ::cursorPos X-Git-Tag: 2.0.0~3810 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=b5ddcaa4d1df41e523259214cc1e6ae4387482dd;p=features.git 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 --- diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 36c21a711d..57a1926a0e 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -3314,8 +3314,8 @@ void InsetTabular::draw(PainterInfo & pi, int x, int y) const } if (r + 1 < tabular.nrows()) - y += tabular.rowDescent(r) + tabular.rowAscent(r + 1) - + tabular.interRowSpace(r + 1); + y += tabular.rowDescent(r) + tabular.rowAscent(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())); if (cur.selIsMultiCell() || full_cell_selected) { - y -= tabular.rowAscent(0); for (row_type r = 0; r < tabular.nrows(); ++r) { int xx = x; 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 h = tabular.rowHeight(cell); + int const yy = y - tabular.rowAscent(r); 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; } if (r + 1 < tabular.nrows()) - y += tabular.rowDescent(r) + tabular.rowAscent(r) + y += tabular.rowDescent(r) + tabular.rowAscent(r + 1) + tabular.interRowSpace(r + 1); } @@ -4434,10 +4434,10 @@ void InsetTabular::cursorPos(BufferView const & bv, int const col = tabular.cellColumn(sl.idx()); // y offset correction - for (int r = 0; r < row; ++r) { - y += tabular.rowAscent(r + 1) + tabular.rowDescent(r) + for (int r = 0; r < row; ++r) + y += tabular.rowDescent(r) + tabular.rowAscent(r + 1) + tabular.interRowSpace(r + 1); - } + y += tabular.textVOffset(sl.idx()); // x offset correction