#include "MathSupport.h"
#include "BufferView.h"
+#include "ColorSet.h"
#include "CoordCache.h"
#include "MetricsInfo.h"
if (e.marker == InsetMath::NO_MARKER)
return;
- // The color
- bool const highlight = e.inset->mouseHovered(pi.base.bv)
- || e.inset->editing(pi.base.bv);
- ColorCode const pen_color = highlight ? Color_mathframe : Color_mathcorners;
-
CoordCache const & coords = pi.base.bv->coordCache();
Dimension const dim = coords.getInsets().dim(e.inset);
pi.pain.text(l, y + dim.des - namedim.des - 1, e.inset->name(), font);
}
+ // Color for corners
+ bool const highlight = e.inset->mouseHovered(pi.base.bv)
+ || e.inset->editing(pi.base.bv);
+ ColorCode const pen_color = highlight ? Color_mathframe : Color_mathcorners;
+ // If the corners have the same color as the background, do not paint them.
+ if (lcolor.getX11Name(Color_mathbg) == lcolor.getX11Name(pen_color))
+ return;
+
// Lower corners in all cases
int const d = y + dim.descent();
pi.pain.line(l, d - 3, l, d, pen_color);
void MathRow::metrics(MetricsInfo & mi, Dimension & dim)
{
- dim.asc = 0;
- dim.wid = 0;
// In order to compute the dimension of macros and their
// arguments, it is necessary to keep track of them.
vector<pair<InsetMath const *, Dimension>> dim_insets;