]> git.lyx.org Git - lyx.git/commitdiff
small advances with \mbox
authorAndré Pönitz <poenitz@gmx.net>
Tue, 4 Jun 2002 09:06:04 +0000 (09:06 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Tue, 4 Jun 2002 09:06:04 +0000 (09:06 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4331 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/formulabase.C
src/mathed/math_boxinset.C
src/mathed/math_boxinset.h
src/mathed/math_fontinset.h
src/mathed/math_hullinset.C
src/mathed/math_hullinset.h

index 66317c27d627469c88483d30a95bb3424c950538..09f31f55647133c3692dd408223079235a981ca3 100644 (file)
@@ -155,7 +155,6 @@ void InsetFormulaBase::metrics(BufferView * bv) const
        mi.base.style = display() ? LM_ST_DISPLAY : LM_ST_TEXT;
        mi.base.font  = font_;
        mi.base.font.setColor(LColor::math);
-       //whichFont(mi.font, LM_TC_MIN, mi);
        par()->metrics(mi);
 }
 
index eeb4005c55d0f075e56fd0792254344334b79f84..3d5f14b6adc567282a8dd5dc285795b90172d518 100644 (file)
@@ -41,8 +41,16 @@ void MathBoxInset::rebreak()
 }
 
 
-void MathBoxInset::draw(MathPainterInfo & pain, int x, int y) const
+void MathBoxInset::metrics(MathMetricsInfo & mi) const
 {
-       MathGridInset::draw(pain, x, y);
-       mathed_draw_framebox(pain, x, y, this);
+       MathFontSetChanger dummy(mi.base, "textnormal");
+       MathGridInset::metrics(mi);
+}
+
+
+void MathBoxInset::draw(MathPainterInfo & pi, int x, int y) const
+{
+       MathFontSetChanger dummy(pi.base, "textnormal");
+       MathGridInset::draw(pi, x, y);
+       mathed_draw_framebox(pi, x, y, this);
 }
index 0dfc8e44760caa4c344ca52eca9ec80bab018c9d..cbf358edd8e3c30dc80c256ac29d055a55795757 100644 (file)
@@ -16,9 +16,13 @@ class LyXFont;
 class MathBoxInset : public MathGridInset {
 public:
        ///
-       explicit MathBoxInset(string const &);
+       explicit MathBoxInset(string const & name);
        ///
        MathInset * clone() const;
+       ///
+       void metrics(MathMetricsInfo & mi) const;
+       ///
+       void draw(MathPainterInfo & pi, int x, int y) const;
        /// identifies BoxInsets
        MathBoxInset * asBoxInset() { return this; }
        /// identifies BoxInsets
@@ -28,9 +32,7 @@ public:
        ///
        void write(WriteStream & os) const;
        ///
-       void normalize(NormalStream &) const;
-       ///
-       void draw(MathPainterInfo &, int x, int y) const;
+       void normalize(NormalStream & ns) const;
 
 private:
        ///
index 1c62eb9a7b0071844297b8ff5608fb8cf799fd3f..a07f2ad02eaf2b7168e393f6b0ed2830d19485cc 100644 (file)
@@ -21,13 +21,13 @@ public:
        ///
        MathInset * clone() const;
        ///
-       void metrics(MathMetricsInfo & st) const;
+       void metrics(MathMetricsInfo & mi) const;
        ///
-       void draw(MathPainterInfo &, int x, int y) const;
+       void draw(MathPainterInfo & pi, int x, int y) const;
        ///
-       void metricsT(TextMetricsInfo const & st) const;
+       void metricsT(TextMetricsInfo const & mi) const;
        ///
-       void drawT(TextPainter &, int x, int y) const;
+       void drawT(TextPainter & pi, int x, int y) const;
        ///
        void write(WriteStream & os) const;
        ///
index 010d1758dda5eea7bbfb3a54e6e3c71b8e40ccd0..25b076855b65302e1cd9eee532037027ae018b6a 100644 (file)
@@ -159,6 +159,7 @@ int MathHullInset::defaultColSpace(col_type col)
 
 void MathHullInset::metrics(MathMetricsInfo & mi) const
 {
+
        // let the cells adjust themselves
        MathGridInset::metrics(mi);
 
@@ -167,14 +168,11 @@ void MathHullInset::metrics(MathMetricsInfo & mi) const
                descent_ += 12;
        }
 
-       mi_ = mi;
-       mi_.base.style = (getType() == LM_OT_SIMPLE) ? LM_ST_TEXT : LM_ST_DISPLAY;
-
        if (numberedType()) {
                //augmentFont(mi_.base.font, "mathbf");
                int l = 0;
                for (row_type row = 0; row < nrows(); ++row)
-                       l = max(l, mathed_string_width(mi_.base.font, nicelabel(row)));
+                       l = max(l, mathed_string_width(mi.base.font, nicelabel(row)));
 
                if (l)
                        width_ += 30 + l;
@@ -183,7 +181,7 @@ void MathHullInset::metrics(MathMetricsInfo & mi) const
        // make it at least as high as the current font
        int asc = 0;
        int des = 0;
-       math_font_max_dim(mi_.base.font, asc, des);
+       math_font_max_dim(mi.base.font, asc, des);
        ascent_  = max(ascent_,  asc);
        descent_ = max(descent_, des);
 }
index 3b09efe7db7e5254b4294eb85e00ecc313c592b6..8202b807bc46a2b06a0be35298ba750716e83ffe 100644 (file)
@@ -109,8 +109,6 @@ private:
        std::vector<int> nonum_;
        ///
        std::vector<string> label_;
-       ///
-       mutable MathMetricsInfo mi_;
 };
 
 #endif