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::write(MathWriteInfo & os) const
26 os << '{' << cell(0) << '}';
30 void MathBraceInset::writeNormal(NormalStream & os) const
33 cell(0).writeNormal(os);
38 void MathBraceInset::metrics(MathMetricsInfo const & mi) const
42 mathed_char_dim(LM_TC_TEX, mi, '{', a, d, wid_);
43 ascent_ = std::max(xcell(0).ascent(), a);
44 descent_ = std::max(xcell(0).descent(), a);
45 width_ = xcell(0).width() + 2 * wid_;
49 void MathBraceInset::draw(Painter & pain, int x, int y) const
51 drawChar(pain, LM_TC_TEX, mi_, x, y, '{');
52 xcell(0).draw(pain, x + wid_, y);
53 drawChar(pain, LM_TC_TEX, mi_, x + width_ - wid_, y, '}');