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);
}
}
-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);
}
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
///
void write(WriteStream & os) const;
///
- void normalize(NormalStream &) const;
- ///
- void draw(MathPainterInfo &, int x, int y) const;
+ void normalize(NormalStream & ns) const;
private:
///
///
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;
///
void MathHullInset::metrics(MathMetricsInfo & mi) const
{
+
// let the cells adjust themselves
MathGridInset::metrics(mi);
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;
// 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);
}
std::vector<int> nonum_;
///
std::vector<string> label_;
- ///
- mutable MathMetricsInfo mi_;
};
#endif