3 #include "math_dotsinset.h"
4 #include "mathed/support.h"
7 MathDotsInset::MathDotsInset(string const & nam, int id, short st)
8 : MathedInset(nam, LM_OT_DOTS, st), code(id) {}
11 MathedInset * MathDotsInset::Clone()
13 return new MathDotsInset(name, code, GetStyle());
18 MathDotsInset::draw(Painter & pain, int x, int y)
20 mathed_draw_deco(pain, x + 2, y - dh, width - 2, ascent, code);
21 if (code == LM_vdots || code == LM_ddots) ++x;
22 if (code != LM_vdots) --y;
23 mathed_draw_deco(pain, x + 2, y - dh, width - 2, ascent, code);
28 MathDotsInset::Metrics()
30 mathed_char_height(LM_TC_VAR, size, 'M', ascent, descent);
31 width = mathed_char_width(LM_TC_VAR, size, 'M');
33 case LM_ldots: dh = 0; break;
34 case LM_cdots: dh = ascent/2; break;
35 case LM_vdots: width /= 2;
36 case LM_ddots: dh = ascent; break;
42 MathDotsInset::Write(ostream & os, bool /* fragile */)
44 os << '\\' << name << ' ';