]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_kerninset.C
Fix event loop to no longer eat CPU
[lyx.git] / src / mathed / math_kerninset.C
index a7ac65c906f124264e7f5b7ae44bca37938ec561..d5e533997710a111ed9dff1465734ab6bdb9b59c 100644 (file)
@@ -34,7 +34,7 @@ MathKernInset::MathKernInset(string const & s)
 {}
 
 
-auto_ptr<InsetBase> MathKernInset::clone() const
+auto_ptr<InsetBase> MathKernInset::doClone() const
 {
        return auto_ptr<InsetBase>(new MathKernInset(*this));
 }
@@ -42,23 +42,26 @@ auto_ptr<InsetBase> MathKernInset::clone() const
 
 void MathKernInset::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       dim.wid = wid_.inPixels(0, mathed_char_width(mi.base.font, 'M'));
+       wid_pix_ = wid_.inPixels(0, mathed_char_width(mi.base.font, 'M'));
+       dim.wid = wid_pix_;
        dim.asc = 0;
        dim.des = 0;
 }
 
 
+int MathKernInset::width() const
+{
+       return wid_pix_;
+}
+
+
 void MathKernInset::draw(PainterInfo &, int, int) const
 {}
 
 
 void MathKernInset::write(WriteStream & os) const
 {
-#ifdef WITH_WARNINGS
-#warning this crashs on startup!
-#endif
-       //os << "\\kern" << wid_.asLatexString() << ' ';
-       os << "\\kern0mm ";
+       os << "\\kern" << wid_.asLatexString() << ' ';
 }