mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-05 13:26:21 +00:00
fix drawing of displayed formula
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7606 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
ef2290cf5e
commit
f23775f346
@ -234,7 +234,7 @@ void InsetFormula::draw(PainterInfo & pi, int x, int y) const
|
||||
//p.pain.rectangle(x, y - a, w, h, LColor::mathframe);
|
||||
}
|
||||
|
||||
par_->draw(p, x, y);
|
||||
par_->draw(p, x + offset_, y);
|
||||
}
|
||||
|
||||
xo_ = x;
|
||||
@ -287,6 +287,14 @@ void InsetFormula::metrics(MetricsInfo & m, Dimension & dim) const
|
||||
dim.asc += 1;
|
||||
dim.des += 1;
|
||||
}
|
||||
|
||||
if (display()) {
|
||||
offset_ = (m.base.textwidth - dim.wid) / 2;
|
||||
dim.wid = m.base.textwidth;
|
||||
} else {
|
||||
offset_ = 0;
|
||||
}
|
||||
|
||||
dim_ = dim;
|
||||
}
|
||||
|
||||
|
@ -78,6 +78,8 @@ private:
|
||||
|
||||
/// contents
|
||||
MathAtom par_;
|
||||
/// x offset for drawing displayed formula
|
||||
mutable int offset_;
|
||||
|
||||
/// Use the Pimpl idiom to hide the internals of the previewer.
|
||||
class PreviewImpl;
|
||||
|
Loading…
Reference in New Issue
Block a user