7 #include "math_dotsinset.h"
8 #include "math_mathmlstream.h"
9 #include "math_streamstr.h"
10 #include "math_support.h"
13 MathDotsInset::MathDotsInset(string const & name)
18 MathInset * MathDotsInset::clone() const
20 return new MathDotsInset(*this);
24 void MathDotsInset::metrics(MathMetricsInfo & mi) const
26 mathed_char_dim(mi.base.font, 'M', ascent_, descent_, width_);
27 if (name_ == "ldots" || name_ == "dotsm")
29 else if (name_ == "cdots" || name_ == "dotsb"
30 || name_ == "dotsm" || name_ == "dotsi")
32 else if (name_ == "dotsc")
34 else if (name_ == "vdots")
36 else if (name_ == "ddots")
41 void MathDotsInset::draw(MathPainterInfo & pain, int x, int y) const
43 mathed_draw_deco(pain, x + 2, y - dh_, width_ - 2, ascent_, name_);
44 if (name_ == "vdots" || name_ == "ddots")
48 mathed_draw_deco(pain, x + 2, y - dh_, width_ - 2, ascent_, name_);
52 void MathDotsInset::write(WriteStream & os) const
54 os << '\\' << name_ << ' ';
58 void MathDotsInset::normalize(NormalStream & os) const
60 os << "[" << name_ << "] ";