5 #include "math_spaceinset.h"
9 #include "support/LOstream.h"
13 MathSpaceInset::MathSpaceInset(int sp)
18 MathInset * MathSpaceInset::clone() const
20 return new MathSpaceInset(*this);
24 void MathSpaceInset::write(MathWriteInfo & os) const
26 if (space_ >= 0 && space_ < 6)
27 os << '\\' << latex_mathspace[space_] << ' ';
31 void MathSpaceInset::writeNormal(std::ostream & os) const
33 os << "[space " << space_ << "] ";
37 void MathSpaceInset::metrics(MathMetricsInfo const & mi) const
39 width_ = space_ ? space_ * 2 : 2;
50 void MathSpaceInset::draw(Painter & pain, int x, int y) const
53 // XPoint p[4] = {{++x, y-3}, {x, y}, {x+width-2, y}, {x+width-2, y-3}};
55 // Sadly, HP-UX CC can't handle that kind of initialization.
60 xp[0] = ++x; yp[0] = y - 3;
62 xp[2] = x + width_ - 2; yp[2] = y;
63 xp[3] = x + width_ - 2; yp[3] = y - 3;
65 pain.lines(xp, yp, 4, space_ ? LColor::latex : LColor::math);
69 void MathSpaceInset::incSpace()
71 space_ = (space_ + 1) % 6;