x += scroll();
x += TEXT_TO_INSET_OFFSET;
+ y -= text_.firstRow()->ascent_of_text();
text_.xo_ = x;
- text_.yo_ = y - text_.firstRow()->ascent_of_text() + bv->top_y();
+ text_.yo_ = y + bv->top_y();
paintTextInset(*bv, text_, x, y);
tmpx -= singleWidth(body_pos - 1);
}
+ tmpx += singleWidth(pos);
+
if (hfillExpansion(*pit_, row_, pos)) {
- tmpx += singleWidth(pos);
if (pos >= body_pos)
tmpx += hfill_;
else
tmpx += label_hfill_;
- }
-
- else if (pit_->isSeparator(pos)) {
- tmpx += singleWidth(pos);
- if (pos >= body_pos)
- tmpx += separator_;
} else {
- tmpx += singleWidth(pos);
+ if (pit_->isSeparator(pos) && pos >= body_pos)
+ tmpx += separator_;
}
if ((startrow != rit_ || text_.selection.start.pos() <= pos) &&
int xo, int yo, int y)
{
//lyxerr << " paintRows: rit: " << &*rit << endl;
- int const yy = yo;
int const y2 = bv.painter().paperHeight();
ParagraphList::iterator end = text.ownerParagraphs().end();
//lyxerr << " paintRows: row: " << &*row << " ignored" << endl;
}
}
- if (yy + y >= y2)
+ if (yo + y >= y2)
return y;
}
}
-void paintTextInset(BufferView & bv, LyXText & text, int xo, int baseline)
+void paintTextInset(BufferView & bv, LyXText & text, int xo, int yo)
{
- RowList::iterator rit = text.firstRow();
ParagraphList::iterator pit = text.ownerParagraphs().begin();
- paintRows(bv, text, pit, rit, xo, baseline - rit->ascent_of_text(), 0);
+ paintRows(bv, text, pit, pit->rows.begin(), xo, yo, 0);
}