2 #include "math_undersetinset.h"
3 #include "math_mathmlstream.h"
4 #include "math_support.h"
10 MathUndersetInset::MathUndersetInset()
14 InsetBase * MathUndersetInset::clone() const
16 return new MathUndersetInset(*this);
20 void MathUndersetInset::metrics(MetricsInfo & mi, Dimension & dim) const
23 FracChanger dummy(mi.base);
25 dim_.wid = max(cell(0).width(), cell(1).width()) + 4;
26 dim_.asc = cell(1).ascent();
27 dim_.des = cell(1).descent() + cell(0).height() + 4;
32 void MathUndersetInset::draw(PainterInfo & pi, int x, int y) const
34 int m = x + pi.width / 2;
35 int yo = y + cell(1).descent() + cell(0).ascent() + 1;
36 cell(1).draw(pi, m - cell(1).width() / 2, y);
37 FracChanger dummy(pi.base);
38 cell(0).draw(pi, m - cell(0).width() / 2, yo);
42 void MathUndersetInset::write(WriteStream & os) const
44 os << "\\underset{" << cell(0) << "}{" << cell(1) << '}';
48 void MathUndersetInset::normalize(NormalStream & os) const
50 os << "[underset " << cell(0) << ' ' << cell(1) << ']';