#include "Painter.h"
MathRootInset::MathRootInset()
- : MathInset(2)
+ : MathNestInset(2)
{}
}
-void MathRootInset::metrics(MathStyles st)
+void MathRootInset::metrics(MathMetricsInfo const & st) const
{
- MathInset::metrics(st);
+ MathNestInset::metrics(st);
size_ = st;
ascent_ = std::max(xcell(0).ascent() + 5, xcell(1).ascent()) + 2;
descent_ = std::max(xcell(1).descent() + 5, xcell(0).descent()) + 2;
}
-void MathRootInset::draw(Painter & pain, int x, int y)
+void MathRootInset::draw(Painter & pain, int x, int y) const
{
xo(x);
yo(y);
}
-void MathRootInset::write(std::ostream & os, bool fragile) const
+void MathRootInset::write(MathWriteInfo & os) const
{
- os << "\\sqrt[";
- cell(0).write(os, fragile);
- os << "]{";
- cell(1).write(os, fragile);
- os << '}';
+ os << "\\sqrt[" << cell(0) << "]{" << cell(1) << '}';
}
os << "] ";
}
+
bool MathRootInset::idxUp(int & idx, int & pos) const
{
if (idx == 0)
return false;
idx = 0;
- pos = 0;
+ pos = cell(0).size();
return true;
}
+
bool MathRootInset::idxDown(int & idx, int & pos) const
{
if (idx == 1)