From: Martin Vermeer Date: Wed, 2 Nov 2005 12:57:47 +0000 (+0000) Subject: Fix bug 2074: kern width wrong X-Git-Tag: 1.6.10~13810 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=b82859b382d33d2b4907a0095217819db07689f1;p=features.git Fix bug 2074: kern width wrong git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10583 a592a061-630c-0410-9148-cb99ea01b6c8 --- 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