]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_kerninset.C
Fix to bug 2362: Deleting superscript also deletes subscript.
[lyx.git] / src / mathed / math_kerninset.C
index b07c8eee1e60ae6a2583d961f0ac9b76ff12fa5a..d5e533997710a111ed9dff1465734ab6bdb9b59c 100644 (file)
@@ -42,23 +42,26 @@ auto_ptr<InsetBase> MathKernInset::doClone() 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() << ' ';
 }