7 #include "math_braceinset.h"
8 #include "math_parser.h"
9 #include "mathed/support.h"
10 #include "support/LOstream.h"
15 MathBraceInset::MathBraceInset()
20 MathInset * MathBraceInset::clone() const
22 return new MathBraceInset(*this);
26 void MathBraceInset::write(MathWriteInfo & os) const
28 os << '{' << cell(0) << '}';
32 void MathBraceInset::writeNormal(std::ostream & os) const
35 cell(0).writeNormal(os);
40 void MathBraceInset::metrics(MathMetricsInfo const & mi) const
44 mathed_char_dim(LM_TC_TEX, mi, '{', a, d, wid_);
45 ascent_ = std::max(xcell(0).ascent(), a);
46 descent_ = std::max(xcell(0).descent(), a);
47 width_ = xcell(0).width() + 2 * wid_;
51 void MathBraceInset::draw(Painter & pain, int x, int y) const
53 drawChar(pain, LM_TC_TEX, mi_, x, y, '{');
54 xcell(0).draw(pain, x + wid_, y);
55 drawChar(pain, LM_TC_TEX, mi_, x + width_ - wid_, y, '}');