]> git.lyx.org Git - features.git/commitdiff
Use proper markers for display version of the math macro template.
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 12 Jun 2017 13:14:23 +0000 (15:14 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 12 Jun 2017 13:15:55 +0000 (15:15 +0200)
This avoids ghost white corners when the macro does not have a display
version.

Part of bug #8883.

src/mathed/MathMacroTemplate.cpp

index d4cf4cfa560bbf830c9b982564ac9fb0aa7c35f8..e12856a15f852bc93f66df0dab6879dab1525d76 100644 (file)
@@ -189,6 +189,8 @@ public:
        DisplayLabelBox(Buffer * buf, MathAtom const & atom, docstring label,
                        MathMacroTemplate const & parent);
 
+       ///
+       marker_type marker(BufferView const *) const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
@@ -215,6 +217,16 @@ Inset * DisplayLabelBox::clone() const
 }
 
 
+InsetMath::marker_type DisplayLabelBox::marker(BufferView const * bv) const
+{
+       if (parent_.editing(bv)
+           || !parent_.cell(parent_.displayIdx()).empty())
+               return MARKER;
+       else
+               return NO_MARKER;
+}
+
+
 void DisplayLabelBox::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        InsetLabelBox::metrics(mi, dim);