5 #include "math_dotsinset.h"
6 #include "mathed/support.h"
7 #include "support/LOstream.h"
12 MathDotsInset::MathDotsInset(string const & name, int id)
13 : MathInset(0, name), code_(id)
17 MathInset * MathDotsInset::clone() const
19 return new MathDotsInset(*this);
23 void MathDotsInset::draw(Painter & pain, int x, int y)
25 mathed_draw_deco(pain, x + 2, y - dh_, width_ - 2, ascent_, code_);
26 if (code_ == LM_vdots || code_ == LM_ddots)
28 if (code_ != LM_vdots)
30 mathed_draw_deco(pain, x + 2, y - dh_, width_ - 2, ascent_, code_);
34 void MathDotsInset::Metrics(MathStyles st)
37 mathed_char_dim(LM_TC_VAR, size(), 'M', ascent_, descent_, width_);
39 case LM_ldots: dh_ = 0; break;
40 case LM_cdots: dh_ = ascent_/2; break;
41 case LM_vdots: width_ /= 2;
42 case LM_ddots: dh_ = ascent_; break;
47 void MathDotsInset::Write(ostream & os, bool /* fragile */) const
49 os << '\\' << name() << ' ';
53 void MathDotsInset::WriteNormal(ostream & os) const
55 os << "[" << name() << "] ";