// Care about multirow cells
if (row + 1 < nrows() &&
cell_info[row][c].multirow == CELL_BEGIN_OF_MULTIROW &&
- cell_info[row][c + 1].multirow == CELL_PART_OF_MULTIROW) {
- cell_info[row][c + 1].multirow = CELL_BEGIN_OF_MULTIROW;
+ cell_info[row + 1][c].multirow == CELL_PART_OF_MULTIROW) {
+ cell_info[row + 1][c].multirow = CELL_BEGIN_OF_MULTIROW;
}
}
row_info.erase(row_info.begin() + row);
}
-int Tabular::rowHeight(idx_type cell) const
+int Tabular::cellHeight(idx_type cell) const
{
row_type const span = rowSpan(cell);
row_type const row = cellRow(cell);
int Tabular::textVOffset(idx_type cell) const
{
- int h = rowHeight(cell);
-
row_type const r = cellRow(cell);
- if (rowSpan(cell) > 1)
- h -= rowDescent(r) + rowAscent(r);
-
- int y = 0;
+ int y = cellHeight(cell) - rowDescent(r) - rowAscent(r);
switch (getVAlignment(cell)) {
case LYX_VALIGN_TOP:
+ y = 0;
break;
case LYX_VALIGN_MIDDLE:
- y += h/2;
+ y = y/2;
break;
case LYX_VALIGN_BOTTOM:
- y += h;
break;
}
-
+
return y;
}
int const cx = nx + tabular.textHOffset(idx);
int const cy = y + tabular.textVOffset(idx);
// Cache the Inset position.
- bv->coordCache().insets().add(cell(idx).get(), cx, y);
+ bv->coordCache().insets().add(cell(idx).get(), cx, cy);
cell(idx)->draw(pi, cx, cy);
drawCellLines(pi.pain, nx, y, r, idx, pi.change_);
nx += tabular.columnWidth(idx);
continue;
}
int const w = tabular.columnWidth(cell);
- int const h = tabular.rowHeight(cell);
+ int const h = tabular.cellHeight(cell);
int const yy = y - tabular.rowAscent(r);
if (isCellSelected(cur, r, c))
pi.pain.fillRectangle(xx, yy, w, h, Color_selection);
{
y = y - tabular.rowAscent(row);
int const w = tabular.columnWidth(cell);
- int const h = tabular.rowHeight(cell);
+ int const h = tabular.cellHeight(cell);
bool on_off = false;
Color col = Color_tabularline;
Color onoffcol = Color_tabularonoffline;
row_type const row = tabular.cellRow(cell);
int const ybeg = o.y_ - tabular.rowAscent(row)
- tabular.interRowSpace(row);
- int const yend = ybeg + tabular.rowHeight(cell);
+ int const yend = ybeg + tabular.cellHeight(cell);
if (x < xbeg)
xx = xbeg - x;