* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author André Pönitz
+ * \author André Pönitz
*
* Full author contact details are available in file CREDITS.
*/
#include "MathStream.h"
#include "MathSupport.h"
#include "frontends/Painter.h"
-#include "debug.h"
+#include "support/debug.h"
+using namespace std;
namespace lyx {
-using std::max;
-
-
InsetMathXYArrow::InsetMathXYArrow()
: InsetMathNest(2)
{}
if (editing()) {
int w = mathed_string_width(mi.base.font, from_ascii("target: "));
- width_ = w + max(cell(0).width(), cell(1).width());
- ascent_ = cell(0).ascent();
- descent_ = cell(0).descent() + cell(1).height() + 10;
+ width_ = w + max(dim0.width(), dim1.wid);
+ ascent_ = dim0.asc;
+ descent_ = dim0.des + dim1.height() + 10;
} else {
width_ = 0;
ascent_ = 0;
cell(0).draw(pi, x + lwid, y);
pi.base.text(x + 3, y, "target");
- y += max(cell(0).descent(), ldes) + 5;
+ y += max(dim0.des, ldes) + 5;
- y += max(cell(1).ascent(), lasc) + 5;
+ y += max(dim1.asc, lasc) + 5;
cell(1).draw(pi, x + lwid, y);
pi.base.text(x + 3, y, "label");
pi.pain.text(x, y, "X");
MathData const & s = sourceCell();
MathData const & t = targetCell();
- pi.pain.line(s.xm(), s.ym(), t.xm(), t.ym(), Color::math);
+ pi.pain.line(s.xm(), s.ym(), t.xm(), t.ym(), Color_math);
cell(1).draw(pi, (s.xm() + t.xm())/2, (s.ym() + t.ym())/2);
}
void InsetMathXYArrow::write(WriteStream & os) const
{
+ MathEnsurer ensurer(os);
os << "\\ar";
if (cell(0).size())
os << '[' << cell(0) << ']';