7 #include "math_dotsinset.h"
8 #include "mathed/support.h"
9 #include "support/LOstream.h"
14 MathDotsInset::MathDotsInset(string const & name, int id)
15 : MathInset(name, LM_OT_DOTS), code_(id)
19 MathInset * MathDotsInset::clone() const
21 return new MathDotsInset(*this);
25 void MathDotsInset::draw(Painter & pain, int x, int y)
27 mathed_draw_deco(pain, x + 2, y - dh_, width_ - 2, ascent_, code_);
28 if (code_ == LM_vdots || code_ == LM_ddots)
30 if (code_ != LM_vdots)
32 mathed_draw_deco(pain, x + 2, y - dh_, width_ - 2, ascent_, code_);
36 void MathDotsInset::Metrics(MathStyles st)
39 mathed_char_dim(LM_TC_VAR, size(), 'M', ascent_, descent_, width_);
41 case LM_ldots: dh_ = 0; break;
42 case LM_cdots: dh_ = ascent_/2; break;
43 case LM_vdots: width_ /= 2;
44 case LM_ddots: dh_ = ascent_; break;
49 void MathDotsInset::Write(ostream & os, bool /* fragile */) const
51 os << '\\' << name() << ' ';
55 void MathDotsInset::WriteNormal(ostream & os) const
57 os << "[" << name() << "] ";