3 #include "math_sqrtinset.h"
8 #include "support/LOstream.h"
12 MathSqrtInset::MathSqrtInset(short st)
13 : MathParInset(st, "sqrt", LM_OT_SQRT) {}
16 MathedInset * MathSqrtInset::Clone()
18 MathSqrtInset * p = new MathSqrtInset(GetStyle());
20 p->SetData(it.Copy());
25 bool MathSqrtInset::Inside(int x, int y)
28 && x <= xo + width - hmax
35 MathSqrtInset::draw(Painter & pain, int x, int y)
37 MathParInset::draw(pain, x + hmax + 2, y);
40 int h2 = Height() / 2;
41 int w2 = (Height() > 4 * hmax) ? hmax : hmax / 2;
43 xp[0] = x + hmax + wbody; yp[0] = y - h;
44 xp[1] = x + hmax; yp[1] = y - h;
45 xp[2] = x + w2; yp[2] = y + d;
46 xp[3] = x; yp[3] = y + d - h2;
47 pain.lines(xp, yp, 4, LColor::mathline);
52 MathSqrtInset::Metrics()
54 MathParInset::Metrics();
58 hmax = mathed_char_height(LM_TC_VAR, size, 'I', a, b);
59 if (hmax < 10) hmax = 10;
65 void MathSqrtInset::Write(ostream & os, bool fragile)
67 os << '\\' << name << '{';
68 MathParInset::Write(os, fragile);