mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 05:33:33 +00:00
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:
parent
701697ec13
commit
72f625da0e
@ -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
|
MathInset * MathMacro::clone() const
|
||||||
{
|
{
|
||||||
return new MathMacro(*this);
|
return new MathMacro(*this);
|
||||||
@ -85,6 +91,8 @@ void MathMacro::draw(Painter & pain, int x, int y)
|
|||||||
xo(x);
|
xo(x);
|
||||||
yo(y);
|
yo(y);
|
||||||
|
|
||||||
|
Metrics(size());
|
||||||
|
|
||||||
LColor::color col;
|
LColor::color col;
|
||||||
|
|
||||||
if (mathcursor && mathcursor->isInside(this)) {
|
if (mathcursor && mathcursor->isInside(this)) {
|
||||||
@ -116,6 +124,7 @@ void MathMacro::draw(Painter & pain, int x, int y)
|
|||||||
col = LColor::black;
|
col = LColor::black;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nargs() > 0)
|
||||||
pain.rectangle(x + 1, y - ascent() + 1, width() - 2, height() - 2, col);
|
pain.rectangle(x + 1, y - ascent() + 1, width() - 2, height() - 2, col);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,6 +39,8 @@ public:
|
|||||||
/// A macro can be built from an existing template
|
/// A macro can be built from an existing template
|
||||||
explicit MathMacro(MathMacroTemplate const &);
|
explicit MathMacro(MathMacroTemplate const &);
|
||||||
///
|
///
|
||||||
|
MathMacro(MathMacro const &);
|
||||||
|
///
|
||||||
void draw(Painter &, int, int);
|
void draw(Painter &, int, int);
|
||||||
///
|
///
|
||||||
void Metrics(MathStyles st, int asc = 0, int des = 0);
|
void Metrics(MathStyles st, int asc = 0, int des = 0);
|
||||||
@ -65,6 +67,8 @@ private:
|
|||||||
MathMacroTemplate const * const tmplate_;
|
MathMacroTemplate const * const tmplate_;
|
||||||
///
|
///
|
||||||
MathXArray expanded_;
|
MathXArray expanded_;
|
||||||
|
///
|
||||||
|
void operator=(MathMacro const &);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user