7 #include "math_xarrowinset.h"
8 #include "math_support.h"
9 #include "math_parser.h"
10 #include "math_mathmlstream.h"
11 #include "math_streamstr.h"
14 MathXArrowInset::MathXArrowInset(string const & name)
15 : MathNestInset(1), name_(name)
19 MathInset * MathXArrowInset::clone() const
21 return new MathXArrowInset(*this);
25 void MathXArrowInset::metrics(MathMetricsInfo & mi) const
27 //MathMetricsInfo mi = st;
28 //smallerStyleScript(mi);
30 dim_.w = cell(0).width() + 10;
31 dim_.a = cell(0).height() + 10;
36 void MathXArrowInset::draw(MathPainterInfo & pain, int x, int y) const
38 cell(0).draw(pain, x + 5, y - 10);
39 mathed_draw_deco(pain, x + 1, y - 7, width() - 2, 5, name_);
43 void MathXArrowInset::write(WriteStream & os) const
45 os << '\\' << name_ << '{' << cell(0) << '}';
49 void MathXArrowInset::normalize(NormalStream & os) const
51 os << "[xarrow " << name_ << ' ' << cell(0) << ']';