LYXERR(Debug::PAINTING) << "\t\t*** START DRAWING ***" << endl;
Text & text = buffer_.text();
TextMetrics const & tm = text_metrics_[&text];
+ int y = metrics_info_.y1 + tm.parMetrics(metrics_info_.p1).ascent();
if (!pi.full_repaint)
- tm.drawParagraph(pi, metrics_info_.p1, 0,
- metrics_info_.y1 + tm.parMetrics(metrics_info_.p1).ascent());
+ tm.drawParagraph(pi, metrics_info_.p1, 0, y);
else
- tm.draw(pi, 0, metrics_info_.y1);
+ tm.draw(pi, 0, y);
LYXERR(Debug::PAINTING) << "\n\t\t*** END DRAWING ***" << endl;
// and grey out above (should not happen later)
ParMetricsCache::const_iterator it = par_metrics_.begin();
ParMetricsCache::const_iterator const pm_end = par_metrics_.end();
+ y -= it->second.ascent();
for (; it != pm_end; ++it) {
ParagraphMetrics const & pmi = it->second;
y += pmi.ascent();
labelwidth_ = pi.pain.text(x, y, full_label_, pi.base.font);
// add some space to separate the label from the inset text
labelwidth_ += 2 * TEXT_TO_INSET_OFFSET;
- int const ty = y - ascent() + TEXT_TO_INSET_OFFSET;
- InsetText::draw(pi, x + labelwidth_, ty);
+ InsetText::draw(pi, x + labelwidth_, y);
setPosCache(pi, x, y);
}
button_dim.y2 = 0;
}
- TextMetrics const & tm = pi.base.bv->textMetrics(&text_);
- int const baseline = y - tm.ascent();
+ int const baseline = y;
int textx, texty;
switch (geometry()) {
case LeftButton:
int const a = tabular.rowAscent(i);
int const d = tabular.rowDescent(i);
idx = tabular.cellIndex(i, 0);
- int const cy = y - a;
for (col_type j = 0; j < tabular.columnCount(); ++j) {
if (tabular.isPartOfMultiColumn(i, j))
continue;
|| y + d < 0
|| y - a > bv->workHeight()) {
pi.pain.setDrawingEnabled(false);
- cell(idx)->draw(pi, cx, cy);
+ cell(idx)->draw(pi, cx, y);
drawCellLines(pi.pain, nx, y, i, idx, pi.erased_);
pi.pain.setDrawingEnabled(true);
} else {
- cell(idx)->draw(pi, cx, cy);
+ cell(idx)->draw(pi, cx, y);
drawCellLines(pi.pain, nx, y, i, idx, pi.erased_);
}
nx += tabular.columnWidth(idx);
int const a = border_;
int const h = a + tm.height() + border_;
if (pi.full_repaint)
- pi.pain.fillRectangle(x, y - a, w, h, backgroundColor());
+ pi.pain.fillRectangle(x, y - a - tm.ascent(), w, h, backgroundColor());
if (drawFrame_)
- pi.pain.rectangle(x, y - a, w, h, frameColor());
+ pi.pain.rectangle(x, y - a - tm.ascent(), w, h, frameColor());
}
tm.draw(pi, x + border_, y);
}