- pain.fillRectangle(int(x), y, w, h, LColor::mathbg);
- pain.rectangle(int(x), y, w, h, LColor::mathframe);
-
- string s(_("Macro: "));
- s += name_;
- pain.text(int(x + 2), baseline, s, font);
- x += width(bv, font) - 1;
+ int const y = baseline - ascent(bv, font) + 1;
+ int const w = width(bv, font) - 2;
+ int const h = ascent(bv, font) + descent(bv, font) - 2;
+
+ // LColor::mathbg used to be "AntiqueWhite" but is "linen" now, too
+ pain.fillRectangle(int(x), y , w, h, LColor::mathmacrobg);
+ pain.rectangle(int(x), y, w, h, LColor::mathframe);
+
+ if (mathcursor && mathcursor->formula() == this && mathcursor->Selection()) {
+ int xp[10];
+ int yp[10];
+ int n;
+ mathcursor->SelGetArea(xp, yp, n);
+ pain.fillPolygon(xp, yp, n, LColor::selection);