From 72f625da0e72ce34a9a0ebf0e5cdee4cc88852ef Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Thu, 12 Jul 2001 11:55:57 +0000 Subject: [PATCH] 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 --- src/mathed/math_macro.C | 11 ++++++++++- src/mathed/math_macro.h | 4 ++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/mathed/math_macro.C b/src/mathed/math_macro.C index 988809f25f..f0a9e13c96 100644 --- a/src/mathed/math_macro.C +++ b/src/mathed/math_macro.C @@ -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,7 +124,8 @@ void MathMacro::draw(Painter & pain, int x, int y) col = LColor::black; } - pain.rectangle(x + 1, y - ascent() + 1, width() - 2, height() - 2, col); + if (nargs() > 0) + pain.rectangle(x + 1, y - ascent() + 1, width() - 2, height() - 2, col); } diff --git a/src/mathed/math_macro.h b/src/mathed/math_macro.h index 1e82f96125..24775e0163 100644 --- a/src/mathed/math_macro.h +++ b/src/mathed/math_macro.h @@ -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 &); }; -- 2.39.2