3 #include "math_dotsinset.h"
4 #include "mathed/support.h"
5 #include "support/LOstream.h"
10 MathDotsInset::MathDotsInset(string const & nam, int id, short st)
11 : MathedInset(nam, LM_OT_DOTS, st), code_(id) {}
14 MathedInset * MathDotsInset::Clone()
16 return new MathDotsInset(name, code_, GetStyle());
21 MathDotsInset::draw(Painter & pain, int x, int y)
23 mathed_draw_deco(pain, x + 2, y - dh_, width - 2, ascent, code_);
24 if (code_ == LM_vdots || code_ == LM_ddots) ++x;
25 if (code_ != LM_vdots) --y;
26 mathed_draw_deco(pain, x + 2, y - dh_, width - 2, ascent, code_);
31 MathDotsInset::Metrics()
33 mathed_char_height(LM_TC_VAR, size(), 'M', ascent, descent);
34 width = mathed_char_width(LM_TC_VAR, size(), 'M');
36 case LM_ldots: dh_ = 0; break;
37 case LM_cdots: dh_ = ascent/2; break;
38 case LM_vdots: width /= 2;
39 case LM_ddots: dh_ = ascent; break;
45 MathDotsInset::Write(ostream & os, bool /* fragile */)
47 os << '\\' << name << ' ';