the fontsize changing in arrays

[And 40 out of 44 occurences had the dummy variable. This fixes the other
two in math_binominset.C, too]


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5355 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2002-10-02 06:38:49 +00:00
parent 8b5e7434b4
commit 98df633ced
5 changed files with 28 additions and 8 deletions

View File

@ -68,10 +68,15 @@ MathInset * MathArrayInset::clone() const
void MathArrayInset::metrics(MathMetricsInfo & mi) const
{
MathMetricsInfo m = mi;
if (m.base.style == LM_ST_DISPLAY)
m.base.style = LM_ST_TEXT;
MathGridInset::metrics(m);
MathArrayChanger dummy(mi.base);
MathGridInset::metrics(mi);
}
void MathArrayInset::draw(MathPainterInfo & pi, int x, int y) const
{
MathArrayChanger dummy(pi.base);
MathGridInset::draw(pi, x, y);
}

View File

@ -30,7 +30,9 @@ public:
///
MathInset * clone() const;
///
void metrics(MathMetricsInfo & st) const;
void metrics(MathMetricsInfo & mi) const;
///
void draw(MathPainterInfo & pi, int x, int y) const;
///
MathArrayInset * asArrayInset() { return this; }
///

View File

@ -37,7 +37,7 @@ int MathBinomInset::dw() const
void MathBinomInset::metrics(MathMetricsInfo & mi) const
{
MathScriptChanger(mi.base);
MathScriptChanger dummy(mi.base);
cell(0).metrics(mi);
cell(1).metrics(mi);
dim_.a = cell(0).height() + 4 + 5;
@ -49,7 +49,7 @@ void MathBinomInset::metrics(MathMetricsInfo & mi) const
void MathBinomInset::draw(MathPainterInfo & pi, int x, int y) const
{
int m = x + width() / 2;
MathScriptChanger(pi.base);
MathScriptChanger dummy(pi.base);
cell(0).draw(pi, m - cell(0).width() / 2, y - cell(0).descent() - 3 - 5);
cell(1).draw(pi, m - cell(1).width() / 2, y + cell(1).ascent() + 3 - 5);
mathed_draw_deco(pi, x, y - ascent(), dw(), height(), "(");

View File

@ -81,6 +81,11 @@ MathFracChanger::MathFracChanger(MathMetricsBase & mb)
MathArrayChanger::MathArrayChanger(MathMetricsBase & mb)
: MathStyleChanger(mb, mb.style == LM_ST_DISPLAY ? LM_ST_TEXT : mb.style)
{}
MathShapeChanger::MathShapeChanger(LyXFont & font, LyXFont::FONT_SHAPE shape)
: MathChanger<LyXFont, LyXFont::FONT_SHAPE>(font)
{

View File

@ -69,7 +69,8 @@ struct TextMetricsInfo {};
// Generic base for temporarily changing things.
// The original state gets restored when the Changer is destructed
// The original state gets restored when the Changer is destructed.
template <class Struct, class Temp = Struct>
struct MathChanger {
///
@ -119,6 +120,13 @@ struct MathFracChanger : public MathStyleChanger {
};
struct MathArrayChanger : public MathStyleChanger {
///
MathArrayChanger(MathMetricsBase & mb);
};
struct MathShapeChanger : public MathChanger<LyXFont, LyXFont::FONT_SHAPE> {
///
MathShapeChanger(LyXFont & font, LyXFont::FONT_SHAPE shape);