Fix bug 2074: kern width wrong

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10583 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Martin Vermeer 2005-11-02 12:57:47 +00:00
parent b063595be8
commit b82859b382
3 changed files with 17 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2005-11-02 Martin Vermeer <martin.vermeer@hut.fi>
* math_kerninset.[Ch]: fix 2074: kern width wrong
2005-10-13 Georg Baum <Georg.Baum@post.rwth-aachen.de> 2005-10-13 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* math_gridinset.[Ch] (eolString, write): Output \\ at the end of the last * math_gridinset.[Ch] (eolString, write): Output \\ at the end of the last

View File

@ -42,12 +42,19 @@ auto_ptr<InsetBase> MathKernInset::doClone() const
void MathKernInset::metrics(MetricsInfo & mi, Dimension & dim) 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.asc = 0;
dim.des = 0; dim.des = 0;
} }
int MathKernInset::width() const
{
return wid_pix_;
}
void MathKernInset::draw(PainterInfo &, int, int) const void MathKernInset::draw(PainterInfo &, int, int) const
{} {}

View File

@ -35,9 +35,14 @@ public:
void write(WriteStream & os) const; void write(WriteStream & os) const;
/// ///
void normalize(NormalStream & ns) const; void normalize(NormalStream & ns) const;
///
int width() const;
private: private:
virtual std::auto_ptr<InsetBase> doClone() const; virtual std::auto_ptr<InsetBase> doClone() const;
/// width in em /// width in em
LyXLength wid_; LyXLength wid_;
/// in pixels
mutable int wid_pix_;
}; };
#endif #endif