7 #include "math_dotsinset.h"
8 #include "mathed/support.h"
9 #include "support/LOstream.h"
14 MathDotsInset::MathDotsInset(string const & nam, int id, short st)
15 : MathedInset(nam, LM_OT_DOTS, st), code_(id) {}
18 MathedInset * MathDotsInset::Clone()
20 return new MathDotsInset(name, code_, GetStyle());
25 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) ++x;
29 if (code_ != LM_vdots) --y;
30 mathed_draw_deco(pain, x + 2, y - dh_, width - 2, ascent, code_);
35 MathDotsInset::Metrics()
37 mathed_char_height(LM_TC_VAR, size(), 'M', ascent, descent);
38 width = mathed_char_width(LM_TC_VAR, size(), 'M');
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;
49 MathDotsInset::Write(ostream & os, bool /* fragile */)
51 os << '\\' << name << ' ';