5 #include "math_dotsinset.h"
6 #include "mathed/support.h"
7 #include "mathed/math_parser.h"
8 #include "support/LOstream.h"
13 MathDotsInset::MathDotsInset(latexkeys const * key)
18 MathInset * MathDotsInset::clone() const
20 return new MathDotsInset(*this);
24 void MathDotsInset::draw(Painter & pain, int x, int y) const
26 mathed_draw_deco(pain, x + 2, y - dh_, width_ - 2, ascent_, key_->id);
27 if (key_->id == LM_vdots || key_->id == LM_ddots)
29 if (key_->id != LM_vdots)
31 mathed_draw_deco(pain, x + 2, y - dh_, width_ - 2, ascent_, key_->id);
35 void MathDotsInset::metrics(MathStyles st) const
38 mathed_char_dim(LM_TC_VAR, size(), 'M', ascent_, descent_, width_);
40 case LM_ldots: dh_ = 0; break;
41 case LM_cdots: dh_ = ascent_ / 2; break;
42 case LM_vdots: width_ /= 2;
43 case LM_ddots: dh_ = ascent_; break;
48 void MathDotsInset::write(ostream & os, bool /* fragile */) const
50 os << '\\' << key_->name << ' ';
54 void MathDotsInset::writeNormal(ostream & os) const
56 os << "[" << key_->name << "] ";