5 #include "math_undersetinset.h"
6 #include "math_mathmlstream.h"
7 #include "math_support.h"
13 MathUndersetInset::MathUndersetInset()
17 MathInset * MathUndersetInset::clone() const
19 return new MathUndersetInset(*this);
23 void MathUndersetInset::metrics(MathMetricsInfo & mi) const
26 MathFracChanger dummy(mi.base);
28 dim_.w = max(cell(0).width(), cell(1).width()) + 4;
29 dim_.a = cell(1).ascent();
30 dim_.d = cell(1).descent() + cell(0).height() + 4;
34 void MathUndersetInset::draw(MathPainterInfo & pi, int x, int y) const
36 int m = x + width() / 2;
37 int yo = y + cell(1).descent() + cell(0).ascent() + 1;
38 cell(1).draw(pi, m - cell(1).width() / 2, y);
39 MathFracChanger dummy(pi.base);
40 cell(0).draw(pi, m - cell(0).width() / 2, yo);
44 void MathUndersetInset::write(WriteStream & os) const
46 os << "\\underset{" << cell(0) << "}{" << cell(1) << '}';
50 void MathUndersetInset::normalize(NormalStream & os) const
52 os << "[underset " << cell(0) << ' ' << cell(1) << ']';