#endif
#include "math_fracinset.h"
-#include "support.h"
+#include "math_support.h"
#include "Painter.h"
#include "math_mathmlstream.h"
}
+MathFracInset * MathFracInset::asFracInset()
+{
+ return atop_ ? 0 : this;
+}
+
+
void MathFracInset::metrics(MathMetricsInfo const & mi) const
{
MathMetricsInfo m = mi;
xcell(0).draw(pain, m - xcell(0).width() / 2, y - xcell(0).descent() - 3 - 5);
xcell(1).draw(pain, m - xcell(1).width() / 2, y + xcell(1).ascent() + 3 - 5);
if (!atop_)
- pain.line(x + 2, y - 5, x + width() - 4, y - 5, LColor::mathline);
+ pain.line(x + 2, y - 5, x + width() - 4, y - 5, LColor::math);
}
-void MathFracInset::write(MathWriteInfo & os) const
+void MathFracInset::write(WriteStream & os) const
{
if (atop_)
os << '{' << cell(0) << "\\atop " << cell(1) << '}';
}
-void MathFracInset::writeNormal(NormalStream & os) const
+void MathFracInset::normalize(NormalStream & os) const
{
if (atop_)
os << "[atop ";
else
os << "[frac ";
- cell(0).writeNormal(os);
- os << " ";
- cell(1).writeNormal(os);
- os << "] ";
+ os << cell(0) << ' ' << cell(1) << ']';
}
void MathFracInset::maplize(MapleStream & os) const
{
- os << '(' << cell(0) << '/' << cell(1) << ')';
+ os << '(' << cell(0) << ")/(" << cell(1) << ')';
}