recompute macro metrics more often to catch changes to the template

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2224 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2001-07-12 11:55:57 +00:00
parent 701697ec13
commit 72f625da0e
2 changed files with 14 additions and 1 deletions

View File

@ -38,6 +38,12 @@ MathMacro::MathMacro(MathMacroTemplate const & t)
{}
MathMacro::MathMacro(MathMacro const & t)
: MathInset(t), tmplate_(t.tmplate_) // don't copy 'expanded_'!
{}
MathInset * MathMacro::clone() const
{
return new MathMacro(*this);
@ -85,6 +91,8 @@ void MathMacro::draw(Painter & pain, int x, int y)
xo(x);
yo(y);
Metrics(size());
LColor::color col;
if (mathcursor && mathcursor->isInside(this)) {
@ -116,6 +124,7 @@ void MathMacro::draw(Painter & pain, int x, int y)
col = LColor::black;
}
if (nargs() > 0)
pain.rectangle(x + 1, y - ascent() + 1, width() - 2, height() - 2, col);
}

View File

@ -39,6 +39,8 @@ public:
/// A macro can be built from an existing template
explicit MathMacro(MathMacroTemplate const &);
///
MathMacro(MathMacro const &);
///
void draw(Painter &, int, int);
///
void Metrics(MathStyles st, int asc = 0, int des = 0);
@ -65,6 +67,8 @@ private:
MathMacroTemplate const * const tmplate_;
///
MathXArray expanded_;
///
void operator=(MathMacro const &);
};