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 << ' ';