- // This is Alejandros domain so I'll use this
- unsigned long pm = scr.getForeground();
-
- lfont_size = f.size();
- mathed_set_font(LM_TC_TEXTRM, LM_ST_TEXT); // otherwise a segfault could occur
- // in some XDrawRectangles (i.e. matrix) (Matthias)
- if (mathcursor && mathcursor->GetPar() == par) {
- if (mathcursor->Selection()) {
- int n;
- XPoint * p = mathcursor->SelGetArea(n);
- XFillPolygon(fl_display, pm, getGC(gc_selection),
- p, n, Nonconvex, CoordModeOrigin);
- }
- mathcursor->Draw(pm, int(x), baseline);
- } else {
-// par->Metrics();
- par->setDrawable(pm);
- par->Draw(int(x), baseline);
- }
- x += float(Width(f));
-
- if (par->GetType() == LM_OT_PARN || par->GetType() == LM_OT_MPARN) {
- char s[80];
- LyXFont font = WhichFont(LM_TC_BF, par->size);
- font.setLatex(LyXFont::OFF);
-
- if (par->GetType() == LM_OT_PARN) {
- if (!label.empty())
- sprintf(s, "(%s)", label.c_str());
- else
- sprintf(s, "(#)");
- font.drawString(s, pm, baseline, int(x+20));
- } else
- if (par->GetType() == LM_OT_MPARN) {
- MathMatrixInset * mt = static_cast<MathMatrixInset*>(par);
- int y;
- MathedRowSt const* crow = mt->getRowSt();
- while (crow) {
- y = baseline + crow->getBaseline();
- if (crow->isNumbered()) {
- if (crow->getLabel())
- sprintf(s, "(%s)", crow->getLabel());
- else
- sprintf(s, "(#)");
- font.drawString(s, pm, y, int(x+20));
- }
- crow = crow->getNext();
- }
- }
- }
- cursor_visible = false;