5 #include "math_stackrelinset.h"
6 #include "mathed/support.h"
7 #include "support/LOstream.h"
10 MathStackrelInset::MathStackrelInset()
14 MathInset * MathStackrelInset::clone() const
16 return new MathStackrelInset(*this);
20 void MathStackrelInset::metrics(MathMetricsInfo const & st) const
23 smallerStyleFrac(size_);
24 xcell(0).metrics(size_);
26 width_ = std::max(xcell(0).width(), xcell(1).width()) + 4;
27 ascent_ = xcell(1).ascent() + xcell(0).height() + 4;
28 descent_ = xcell(1).descent();
32 void MathStackrelInset::draw(Painter & pain, int x, int y) const
36 int m = x + width() / 2;
37 xcell(0).draw(pain, m - xcell(0).width() / 2, y - xcell(0).height() - 4);
38 xcell(1).draw(pain, m - xcell(1).width() / 2, y);
42 void MathStackrelInset::write(MathWriteInfo & os) const
44 os << "\\stackrel{" << cell(0) << "}{" << cell(1) << '}';
48 void MathStackrelInset::writeNormal(std::ostream & os) const
51 cell(0).writeNormal(os);
53 cell(1).writeNormal(os);