7 #include "math_braceinset.h"
8 #include "math_parser.h"
9 #include "math_support.h"
10 #include "math_mathmlstream.h"
13 MathBraceInset::MathBraceInset()
18 MathInset * MathBraceInset::clone() const
20 return new MathBraceInset(*this);
24 void MathBraceInset::metrics(MathMetricsInfo const & mi) const
28 mathed_char_dim(LM_TC_TEX, mi, '{', a, d, wid_);
29 ascent_ = std::max(xcell(0).ascent(), a);
30 descent_ = std::max(xcell(0).descent(), a);
31 width_ = xcell(0).width() + 2 * wid_;
35 void MathBraceInset::draw(Painter & pain, int x, int y) const
37 drawChar(pain, LM_TC_TEX, mi_, x, y, '{');
38 xcell(0).draw(pain, x + wid_, y);
39 drawChar(pain, LM_TC_TEX, mi_, x + width_ - wid_, y, '}');
43 void MathBraceInset::write(WriteStream & os) const
45 os << '{' << cell(0) << '}';
49 void MathBraceInset::normalize(NormalStream & os) const
51 os << "[block " << cell(0) << ']';