]> 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 8807f0ec5b52e6a8e0e947bdcc451af86eab2bbb..d5e533997710a111ed9dff1465734ab6bdb9b59c 100644 (file)
@@ -16,7 +16,6 @@
 #include "math_support.h"
 #include "dimension.h"
 
-
 using std::string;
 using std::auto_ptr;
 
@@ -35,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));
 }
@@ -43,12 +42,19 @@ 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
 {}