From: Jean-Marc Lasgouttes Date: Fri, 13 Jan 2017 09:17:05 +0000 (+0100) Subject: BOX tweak X-Git-Tag: 2.3.0alpha1~460 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=596c9065e6feb8cfaadf79abd8cc73233d9442f1;p=features.git BOX tweak --- diff --git a/src/mathed/MathRow.cpp b/src/mathed/MathRow.cpp index 9465b32690..7eb5eb6d2a 100644 --- a/src/mathed/MathRow.cpp +++ b/src/mathed/MathRow.cpp @@ -175,7 +175,8 @@ void MathRow::metrics(MetricsInfo & mi, Dimension & dim) const break; case BOX: d = theFontMetrics(mi.base.font).dimension('I'); - d.wid += e.before + e.after; + // allow for one pixel in front of the box. + d.wid += e.before + e.after + 1; break; } @@ -288,7 +289,7 @@ void MathRow::draw(PainterInfo & pi, int x, int const y) const Dimension const d = theFontMetrics(pi.base.font).dimension('I'); // the box is not visible in non-editable context (except for grey macro boxes). if (e.color != Color_none) - pi.pain.rectangle(x + e.before, y - d.ascent(), + pi.pain.rectangle(x + e.before + 1, y - d.ascent(), d.width() - 1, d.height() - 1, e.color); x += d.wid + e.before + e.after; break;