5 #include "math_sqrtinset.h"
8 #include "support/LOstream.h"
11 MathSqrtInset::MathSqrtInset()
16 MathInset * MathSqrtInset::clone() const
18 return new MathSqrtInset(*this);
22 void MathSqrtInset::metrics(MathStyles st) const
26 ascent_ = xcell(0).ascent() + 4;
27 descent_ = xcell(0).descent() + 2;
28 width_ = xcell(0).width() + 12;
32 void MathSqrtInset::draw(Painter & pain, int x, int y) const
36 xcell(0).draw(pain, x + 10, y);
37 int const a = ascent_;
38 int const d = descent_;
41 xp[0] = x + width_; yp[0] = y - a + 1;
42 xp[1] = x + 8; yp[1] = y - a + 1;
43 xp[2] = x + 5; yp[2] = y + d - 1;
44 xp[3] = x; yp[3] = y + (d - a)/2;
45 pain.lines(xp, yp, 4, LColor::mathline);
49 void MathSqrtInset::write(std::ostream & os, bool fragile) const
52 cell(0).write(os, fragile);
57 void MathSqrtInset::writeNormal(std::ostream & os) const
60 cell(0).writeNormal(os);