#include <config.h>
#include "math_data.h"
-#include "math_cursor.h"
#include "math_fontinset.h"
#include "math_scriptinset.h"
#include "math_mathmlstream.h"
for (const_iterator it = begin(), et = end(); it != et; ++it) {
(*it)->metrics(mi, d);
dim_ += d;
- it->width_ = d.wid;
+ //it->width_ = d.wid;
}
}
}
}
for (const_iterator it = begin(), et = end(); it != et; ++it) {
- pi.width = it->width_;
+ //pi.width = it->width_;
(*it)->draw(pi, x, y);
- x += it->width_;
+ x += (*it)->width();
}
}
for (const_iterator it = begin(), et = end(); it != et; ++it) {
(*it)->drawT(pain, x, y);
- x += it->width_;
+ //x += (*it->width_;
+ x += 2;
}
}
const_iterator it = begin() + i;
if ((*it)->getChar() == ' ')
x += glue;
- x += it->width_;
+ //lyxerr << "char: " << (*it)->getChar()
+ // << "width: " << (*it)->width() << std::endl;
+ x += (*it)->width();
}
return x;
}
lastx = currx;
if ((*it)->getChar() == ' ')
currx += glue;
- currx += it->width_;
+ currx += (*it)->width();
}
if (abs(lastx - targetx) < abs(currx - targetx) && it != begin())
--it;
}
+bool MathArray::contains(int x, int y) const
+{
+ return xo_ <= x && x <= xo_ + width()
+ && yo_ - ascent() <= y && y <= yo_ + descent();
+}
+
+
void MathArray::center(int & x, int & y) const
{
x = xo_ + width() / 2;
{
// do not recurse!
+/*
// remove base-only "scripts"
for (pos_type i = 0; i + 1 < size(); ++i) {
MathScriptInset * p = operator[](i).nucleus()->asScriptInset();
mathcursor->adjust(i, -1);
}
}
-
+*/
}