7 #include "math_spaceinset.h"
10 #include "mathed/support.h"
11 #include "support/LOstream.h"
16 MathSpaceInset::MathSpaceInset(int sp, short ot, short st)
17 : MathedInset("", ot, st), space_(sp)
21 MathedInset * MathSpaceInset::Clone()
23 return new MathSpaceInset(space_, GetType(), GetStyle());
28 MathSpaceInset::draw(Painter & pain, int x, int y)
31 // XPoint p[4] = {{++x, y-3}, {x, y}, {x+width-2, y}, {x+width-2, y-3}};
33 // Sadly, HP-UX CC can't handle that kind of initialization.
38 xp[0] = ++x; yp[0] = y - 3;
40 xp[2] = x + width - 2; yp[2] = y;
41 xp[3] = x + width - 2; yp[3] = y - 3;
43 pain.lines(xp, yp, 4, (space_) ? LColor::latex : LColor::math);
48 MathSpaceInset::Write(ostream & os, bool /* fragile */)
50 if (space_ >= 0 && space_ < 6) {
51 os << '\\' << latex_mathspace[space_] << ' ';
56 void MathSpaceInset::Metrics()
58 width = space_ ? space_ * 2 : 2;
59 if (space_ > 3) width *= 2;
60 if (space_ == 5) width *= 2;
67 void MathSpaceInset::SetSpace(int sp)
74 int MathSpaceInset::GetSpace()