3 #include "math_sqrtinset.h"
10 MathSqrtInset::MathSqrtInset(short st)
11 : MathParInset(st, "sqrt", LM_OT_SQRT) {}
14 MathedInset * MathSqrtInset::Clone()
16 MathSqrtInset * p = new MathSqrtInset(GetStyle());
18 p->SetData(it.Copy());
23 bool MathSqrtInset::Inside(int x, int y)
26 && x <= xo + width - hmax
33 MathSqrtInset::draw(Painter & pain, int x, int y)
35 MathParInset::draw(pain, x + hmax + 2, y);
38 int h2 = Height() / 2;
39 int w2 = (Height() > 4 * hmax) ? hmax : hmax / 2;
41 xp[0] = x + hmax + wbody; yp[0] = y - h;
42 xp[1] = x + hmax; yp[1] = y - h;
43 xp[2] = x + w2; yp[2] = y + d;
44 xp[3] = x; yp[3] = y + d - h2;
45 pain.lines(xp, yp, 4, LColor::mathline);
50 MathSqrtInset::Metrics()
52 MathParInset::Metrics();
56 hmax = mathed_char_height(LM_TC_VAR, size, 'I', a, b);
57 if (hmax < 10) hmax = 10;
63 void MathSqrtInset::Write(ostream & os, bool fragile)
65 os << '\\' << name << '{';
66 MathParInset::Write(os, fragile);