#include "math_support.h"
#include "LaTeXFeatures.h"
#include "textpainter.h"
+#include "frontends/Painter.h"
MathFontInset::MathFontInset(string const & name)
: MathNestInset(1), name_(name)
{
- lock(true);
+ //lock(true);
}
{
MathFontSetChanger dummy(mi.base, name_.c_str());
xcell(0).metrics(mi);
- width_ = xcell(0).width();
+ width_ = xcell(0).width() + 6;
ascent_ = xcell(0).ascent();
- descent_ = xcell(0).descent();
+ descent_ = xcell(0).descent() + 3;
}
//lyxerr << "MathFontInset::draw\n";
MathNestInset::draw(pi, x, y);
MathFontSetChanger dummy(pi.base, name_.c_str());
- xcell(0).draw(pi, x, y);
+ xcell(0).draw(pi, x + 3, y);
+ int b = x + 1;
+ int t = x + width() - 1;
+ int d = y + descent();
+ pi.pain.line(b, d - 3, b, d, LColor::mathframe);
+ pi.pain.line(t, d - 3, t, d, LColor::mathframe);
+ pi.pain.line(b, d, b + 3, d, LColor::mathframe);
+ pi.pain.line(t - 2, d, t, d, LColor::mathframe);
}
-void mathed_draw_deco(MathPainterInfo & pain, int x, int y, int w, int h,
+void mathed_draw_deco(MathPainterInfo & pi, int x, int y, int w, int h,
const string & name)
{
if (name == ".") {
- pain.pain.line(x + w/2, y, x + w/2, y + h,
+ pi.pain.line(x + w/2, y, x + w/2, y + h,
LColor::mathcursor, Painter::line_onoffdash);
return;
}
else
mt.transform(xx, yy);
mt.transform(x2, y2);
- pain.pain.line(
+ pi.pain.line(
x + int(xx + 0.5), y + int(yy + 0.5),
x + int(x2 + 0.5), y + int(y2 + 0.5),
LColor::math);
yp[j] = y + int(yy + 0.5);
// lyxerr << "P[" << j " " << xx << " " << yy << " " << x << " " << y << "]";
}
- pain.pain.lines(xp, yp, n, LColor::math);
+ pi.pain.lines(xp, yp, n, LColor::math);
}
}
}
-void mathed_draw_framebox(MathPainterInfo & pain, int x, int y, MathInset const * p)
+void mathed_draw_framebox(MathPainterInfo & pi, int x, int y, MathInset const * p)
{
if (mathcursor && mathcursor->isInside(p))
- pain.pain.rectangle(x, y - p->ascent(), p->width(), p->height(),
+ pi.pain.rectangle(x, y - p->ascent(), p->width(), p->height(),
LColor::mathframe);
}
// In the future maybe we use a better fonts renderer
-void drawStr(MathPainterInfo & pain, LyXFont const & font,
+void drawStr(MathPainterInfo & pi, LyXFont const & font,
int x, int y, string const & str)
{
- pain.pain.text(x, y, str, font);
+ pi.pain.text(x, y, str, font);
}