break;
case InsetMath::BOX_MARKER:
FontInfo font;
- font.setSize(FONT_SIZE_TINY);
+ font.setSize(TINY_SIZE);
Dimension namedim;
mathed_string_dim(font, e.inset->name(), namedim);
int const namewid = 1 + namedim.wid + 1;
if (e.marker == InsetMath::BOX_MARKER) {
// draw header and rectangle around
FontInfo font;
- font.setSize(FONT_SIZE_TINY);
+ font.setSize(TINY_SIZE);
font.setColor(Color_mathmacrolabel);
Dimension namedim;
mathed_string_dim(font, e.inset->name(), namedim);
void MathRow::metrics(MetricsInfo & mi, Dimension & dim)
{
- frontend::FontMetrics const & fm = theFontMetrics(mi.base.font);
- // FIXME: this is the minimal ascent seen empirically, check
- // what the TeXbook says.
- dim.asc = fm.ascent('x');
dim.wid = 0;
// In order to compute the dimension of macros and their
// arguments, it is necessary to keep track of them.
}
break;
case BOX:
- d = fm.dimension('I');
+ d = theFontMetrics(mi.base.font).dimension('I');
if (e.color != Color_none) {
// allow for one pixel before/after the box.
d.wid += e.before + e.after + 2;
if (!s1.empty()) {
f.setColor(Color_inlinecompletion);
- pi.pain.text(x, y, s1, f);
+ // offset the text by e.after to make sure that the
+ // spacing is after the completion, not before.
+ pi.pain.text(x - e.after, y, s1, f);
x += mathed_string_width(f, s1);
}
if (!s2.empty()) {
f.setColor(Color_nonunique_inlinecompletion);
- pi.pain.text(x, y, s2, f);
+ pi.pain.text(x - e.after, y, s2, f);
x += mathed_string_width(f, s2);
}
}