]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_xarrowinset.C
Fix event loop to no longer eat CPU
[lyx.git] / src / mathed / math_xarrowinset.C
index c798a5316d181c387a94b800d879db139f0ae6c8..3676171d5438914e4e26993668b5863ba3cde1ac 100644 (file)
@@ -16,6 +16,7 @@
 #include "math_streamstr.h"
 #include "math_support.h"
 
+using std::string;
 using std::auto_ptr;
 
 
@@ -24,7 +25,7 @@ MathXArrowInset::MathXArrowInset(string const & name)
 {}
 
 
-auto_ptr<InsetBase> MathXArrowInset::clone() const
+auto_ptr<InsetBase> MathXArrowInset::doClone() const
 {
        return auto_ptr<InsetBase>(new MathXArrowInset(*this));
 }
@@ -35,10 +36,11 @@ void MathXArrowInset::metrics(MetricsInfo & mi, Dimension & dim) const
        ScriptChanger dummy(mi.base);
        cell(0).metrics(mi);
        cell(1).metrics(mi);
-       dim_.wid = std::max(cell(0).width(), cell(1).width()) + 10;
-       dim_.asc = cell(0).height() + 10;
-       dim_.des = cell(1).height();
-       dim = dim_;
+       dim.wid = std::max(cell(0).width(), cell(1).width()) + 10;
+       dim.asc = cell(0).height() + 10;
+       dim.des = cell(1).height();
+       metricsMarkers(dim);
+       dim_ = dim;
 }
 
 
@@ -47,7 +49,8 @@ void MathXArrowInset::draw(PainterInfo & pi, int x, int y) const
        ScriptChanger dummy(pi.base);
        cell(0).draw(pi, x + 5, y - 10);
        cell(1).draw(pi, x + 5, y + cell(1).height());
-       mathed_draw_deco(pi, x + 1, y - 7, pi.width - 2, 5, name_);
+       mathed_draw_deco(pi, x + 1, y - 7, width() - 2, 5, name_);
+       drawMarkers(pi, x, y);
 }