diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 263899e302..6f8aa85be9 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,7 @@ +2005-11-02 Martin Vermeer + + * math_kerninset.[Ch]: fix 2074: kern width wrong + 2005-10-13 Georg Baum * math_gridinset.[Ch] (eolString, write): Output \\ at the end of the last diff --git a/src/mathed/math_kerninset.C b/src/mathed/math_kerninset.C index 00c8bcb99d..d5e5339977 100644 --- a/src/mathed/math_kerninset.C +++ b/src/mathed/math_kerninset.C @@ -42,12 +42,19 @@ auto_ptr 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 {} diff --git a/src/mathed/math_kerninset.h b/src/mathed/math_kerninset.h index 48d50638b8..817fbb4cf1 100644 --- a/src/mathed/math_kerninset.h +++ b/src/mathed/math_kerninset.h @@ -35,9 +35,14 @@ public: void write(WriteStream & os) const; /// void normalize(NormalStream & ns) const; + /// + int width() const; private: virtual std::auto_ptr doClone() const; /// width in em LyXLength wid_; + /// in pixels + mutable int wid_pix_; + }; #endif