]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathRow.cpp
Removed unused private variable
[lyx.git] / src / mathed / MathRow.cpp
index 71e7a5234aeb652b214f3cb6b0d3bac9d7101940..cc3e5a3dab988d298c5aa879affc6bf10c522b83 100644 (file)
@@ -18,6 +18,7 @@
 #include "MathSupport.h"
 
 #include "BufferView.h"
+#include "ColorSet.h"
 #include "CoordCache.h"
 #include "MetricsInfo.h"
 
@@ -97,11 +98,6 @@ void drawMarkers(PainterInfo const & pi, MathRow::Element const & e,
        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);
 
@@ -122,6 +118,14 @@ void drawMarkers(PainterInfo const & pi, MathRow::Element const & e,
                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);
@@ -232,8 +236,6 @@ int MathRow::after(int i) const
 
 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;