7 #include "math_sizeinset.h"
8 #include "math_parser.h"
9 #include "math_mathmlstream.h"
10 #include "math_streamstr.h"
11 #include "math_support.h"
14 MathSizeInset::MathSizeInset(latexkeys const * l)
15 : MathNestInset(1), key_(l)
19 MathInset * MathSizeInset::clone() const
21 return new MathSizeInset(*this);
25 void MathSizeInset::draw(Painter & pain, int x, int y) const
27 xcell(0).draw(pain, x + 1, y);
28 mathed_draw_framebox(pain, x, y, this);
32 void MathSizeInset::metrics(MathMetricsInfo const & mi) const
34 MathMetricsInfo m = mi;
35 m.style = MathStyles(key_->id);
37 ascent_ = xcell(0).ascent_ + 1;
38 descent_ = xcell(0).descent_ + 1;
39 width_ = xcell(0).width_ + 2;
43 void MathSizeInset::write(WriteStream & os) const
45 os << "{\\" << key_->name << ' ' << cell(0) << '}';
49 void MathSizeInset::normalize(NormalStream & os) const
51 os << "[" << key_->name << ' ' << cell(0) << ']';