]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_diminset.C
Andreas' patch to prevent crash on click on previewd inset
[lyx.git] / src / mathed / math_diminset.C
index f1253db1921d28dd4fbffb904329bb8e01fd9da1..939e4b89a82a63b41da6dc726a9c665f5bb683fb 100644 (file)
 #include <config.h>
 
 #include "math_diminset.h"
+#include "coordcache.h"
+#include "debug.h"
 
 
-void MathDimInset::metricsT(TextMetricsInfo const &) const
+MathDimInset::MathDimInset()
+{}
+
+
+int MathDimInset::ascent() const
+{
+       return dim_.asc;
+}
+
+
+int MathDimInset::descent() const
+{
+       return dim_.des;
+}
+
+
+int MathDimInset::width() const
 {
-#ifndef WITH_WARNINGS
-#warning temporarily disabled
-#endif
-/*
-       std::ostringstream os;
-       os << MathAtom(this);
-       dim_.wid = int(os.str().size());
-       dim_.asc = 1;
-       dim_.des = 0;
-*/
+       return dim_.wid;
 }
 
 
-void MathDimInset::drawT(TextPainter &, int, int) const
+void MathDimInset::setPosCache(PainterInfo const &, int x, int y) const
 {
-/*
-       std::ostringstream os;
-       os << MathAtom(this);
-       pain.draw(x, y, STRCONV(os.str()));
-*/
+       //lyxerr << "MathDimInset: cache to " << x << " " << y << std::endl;
+       theCoords.insets().add(this, x, y);
 }