7 #include "math_braceinset.h"
8 #include "math_parser.h"
9 #include "math_support.h"
10 #include "math_mathmlstream.h"
11 #include "support/LOstream.h"
16 MathBraceInset::MathBraceInset()
21 MathBraceInset::MathBraceInset(MathArray const & ar)
28 MathInset * MathBraceInset::clone() const
30 return new MathBraceInset(*this);
34 void MathBraceInset::metrics(MathMetricsInfo & mi) const
38 mathed_char_dim(mi.base.font, '{', a, d, wid_);
39 ascent_ = max(xcell(0).ascent(), a);
40 descent_ = max(xcell(0).descent(), a);
41 width_ = xcell(0).width() + 2 * wid_;
45 void MathBraceInset::draw(MathPainterInfo & pi, int x, int y) const
47 LyXFont font = pi.base.font;
48 font.setColor(LColor::latex);
49 drawChar(pi, font, x, y, '{');
50 xcell(0).draw(pi, x + wid_, y);
51 drawChar(pi, font, x + width_ - wid_, y, '}');
55 void MathBraceInset::write(WriteStream & os) const
57 os << '{' << cell(0) << '}';
61 void MathBraceInset::normalize(NormalStream & os) const
63 os << "[block " << cell(0) << ']';
67 void MathBraceInset::infoize(std::ostream & os) const
69 os << "Nested Block: ";