#include "math_diminset.h"
+#include "Lsstream.h"
+#include "textpainter.h"
-MathDimInset::MathDimInset()
- : MathInset(), width_(0), ascent_(0), descent_(0)
-{}
-
-
-int MathDimInset::ascent() const
-{
- return ascent_;
-}
-
-
-int MathDimInset::descent() const
+void MathDimInset::metricsT(TextMetricsInfo const &) const
{
- return descent_;
+ std::ostringstream os;
+ os << *this;
+ width_ = int(os.str().size());
+ ascent_ = 1;
+ descent_ = 0;
}
-int MathDimInset::width() const
+void MathDimInset::drawT(TextPainter & pain, int x, int y) const
{
- return width_;
+ std::ostringstream os;
+ os << *this;
+ pain.draw(x, y, os.str().c_str());
}