]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_diminset.C
oh well
[lyx.git] / src / mathed / math_diminset.C
index 23a595639b18af9fd5342c3a90e283c948051efd..e9de770737d0324aab5e97d22e6419171f35df76 100644 (file)
@@ -1,24 +1,21 @@
 #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());
 }