3 #include "math_spaceinset.h"
6 #include "mathed/support.h"
7 #include "support/LOstream.h"
12 void MathSpaceInset::Metrics()
14 width = space ? space * 2 : 2;
15 if (space > 3) width *= 2;
16 if (space == 5) width *= 2;
18 ascent = 4; descent = 0;
22 void MathSpaceInset::SetSpace(int sp)
29 MathSpaceInset::MathSpaceInset(int sp, short ot, short st)
30 : MathedInset("", ot, st), space(sp)
34 MathedInset * MathSpaceInset::Clone()
36 return new MathSpaceInset(space, GetType(), GetStyle());
41 MathSpaceInset::draw(Painter & pain, int x, int y)
44 // XPoint p[4] = {{++x, y-3}, {x, y}, {x+width-2, y}, {x+width-2, y-3}};
46 // Sadly, HP-UX CC can't handle that kind of initialization.
51 xp[0] = ++x; yp[0] = y - 3;
53 xp[2] = x + width - 2; yp[2] = y;
54 xp[3] = x + width - 2; yp[3] = y - 3;
56 pain.lines(xp, yp, 4, (space) ? LColor::latex : LColor::math);
61 MathSpaceInset::Write(ostream & os, bool /* fragile */)
63 if (space >= 0 && space < 6) {
64 os << '\\' << latex_mathspace[space] << ' ';
69 int MathSpaceInset::GetSpace()