int Tabular::rowHeight(idx_type cell) const
{
- row_type const span = rowSpan(cell);
- row_type const row = cellRow(cell);
- int h = rowAscent(row) + rowDescent(row);
+ row_type const span = rowSpan(cell);
+ row_type const row = cellRow(cell);
+ int h = rowAscent(row) + rowDescent(row);
- for(row_type r = row; r < row + span ; ++r) {
- if (r > row) {
- h += rowAscent(r);
- h += interRowSpace(r);
- }
- if (r < row + span - 1)
- h += rowDescent(r);
- }
- return h;
+ for(row_type r = row; r < row + span ; ++r) {
+ if (r > row) {
+ h += rowAscent(r);
+ h += interRowSpace(r);
+ }
+ if (r < row + span - 1)
+ h += rowDescent(r);
+ }
+ return h;
}
// top y coordinate of tabular
int h = yo(cur.bv()) - tabular.rowAscent(0);
row_type r = 0;
- for (; r < nrows() && y > h; ++r)
+ for (; r < tabular.nrows() && y > h; ++r)
h += tabular.rowAscent(r) + tabular.rowDescent(r)
+ tabular.interRowSpace(r);
// y offset correction
for (int r = 0; r <= row; ++r) {
- if (tabular.isPartOfMultiRow(r, col))
- continue;
if (r != 0) {
y += tabular.rowAscent(r);
y += tabular.interRowSpace(r);
row_type const row = tabular.cellRow(cell);
int const ybeg = o.y_ - tabular.rowAscent(row)
- tabular.interRowSpace(row);
- int const yend = o.y_ + tabular.rowDescent(row);
+ int const yend = ybeg + tabular.rowHeight(cell);
if (x < xbeg)
xx = xbeg - x;
return;
if (cur.idx() == tabular.getLastCellInRow(row))
cur.idx() = tabular.cellIndex(row + 1, 0);
- else
- cur.idx() = tabular.cellIndex(row, col + 1);
+ else {
+ col_type const colnextcell = col + tabular.columnSpan(cur.idx());
+ cur.idx() = tabular.cellIndex(row, colnextcell);
+ }
}
cur.boundary(false);