7 #include "math_braceinset.h"
8 #include "math_parser.h"
9 #include "math_support.h"
10 #include "math_mathmlstream.h"
16 MathBraceInset::MathBraceInset()
21 MathInset * MathBraceInset::clone() const
23 return new MathBraceInset(*this);
27 void MathBraceInset::metrics(MathMetricsInfo const & mi) const
31 mathed_char_dim(LM_TC_TEX, mi, '{', a, d, wid_);
32 ascent_ = max(xcell(0).ascent(), a);
33 descent_ = max(xcell(0).descent(), a);
34 width_ = xcell(0).width() + 2 * wid_;
38 void MathBraceInset::draw(Painter & pain, int x, int y) const
40 drawChar(pain, LM_TC_TEX, mi_, x, y, '{');
41 xcell(0).draw(pain, x + wid_, y);
42 drawChar(pain, LM_TC_TEX, mi_, x + width_ - wid_, y, '}');
46 void MathBraceInset::write(WriteStream & os) const
48 os << '{' << cell(0) << '}';
52 void MathBraceInset::normalize(NormalStream & os) const
54 os << "[block " << cell(0) << ']';