- x + lmargin + cellXOffset(bv, idx),
- y + cellYOffset(idx));
-
- // draw inner lines cell by cell because of possible multicolumns
- // FIXME: multicolumn lines are not yet considered
- row_type const r = row(idx);
- col_type const c = col(idx);
- if (r > 0 && r < nrows()) {
- for (unsigned int i = 0; i < rowinfo_[r].lines_; ++i) {
- int yy = y + rowinfo_[r].offset_
- - rowinfo_[r].ascent_
- - i * hlinesep()
- - hlinesep()/2 - rowsep()/2;
- pi.pain.line(
- x + lmargin + colinfo_[c].offset_,
- yy,
- x + lmargin + colinfo_[c+1].offset_,
- yy, Color_foreground);
- }
- }
- if (c > 0 && c < ncols()) {
- for (unsigned int i = 0; i < colinfo_[c].lines_; ++i) {
- int xx = x + lmargin
- + colinfo_[c].offset_
- - i * vlinesep()
- - vlinesep()/2 - colsep()/2;
- pi.pain.line(xx,
- rowinfo_[r].offset_ - rowinfo_[r].ascent_,
- xx,
- rowinfo_[r].offset_ + rowinfo_[r].descent_,
- Color_foreground);
+ x + leftMargin() + cellXOffset(bv, idx),
+ y + cellYOffset(bv, idx));
+
+ row_type r = row(idx);
+ int const yy1 = y + hLineVOffset(bv, r, 0);
+ int const yy2 = y + hLineVOffset(bv, r + 1, rowinfo_[r + 1].lines - 1);
+ auto draw_left_borders = [&](col_type c) {
+ for (unsigned int i = 0; i < colinfo_[c].lines; ++i) {
+ int const xx = x + vLineHOffset(c, i);
+ pi.pain.line(xx, yy1, xx, yy2, Color_foreground);