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(MathStyles st) const
22 size_ = smallerStyleFrac(st);
23 xcell(0).metrics(size_);
25 width_ = std::max(xcell(0).width(), xcell(1).width()) + 4;
26 ascent_ = xcell(1).ascent() + xcell(0).height() + 4;
27 descent_ = xcell(1).descent();
31 void MathStackrelInset::draw(Painter & pain, int x, int y) const
35 int m = x + width() / 2;
36 xcell(0).draw(pain, m - xcell(0).width() / 2, y - xcell(0).height() - 4);
37 xcell(1).draw(pain, m - xcell(1).width() / 2, y);
41 void MathStackrelInset::write(std::ostream & os, bool fragile) const
44 cell(0).write(os, fragile);
46 cell(1).write(os, fragile);
51 void MathStackrelInset::writeNormal(std::ostream & os) const
54 cell(0).writeNormal(os);
56 cell(1).writeNormal(os);