Exemplo n.º 1
0
void
MMLmsqrt::doPaint(MML::Attributes *a) const {
    MMLNode *sqrt = first;
    v_unit linethickness(0.05, l_unit::em);
    float lineth = linethickness.get(a);
    sqrt->paint(a);

    float ly = -sqrt->getAscent() - 3.5*lineth;
    float d = (gui->ascent + gui->descent)/12;
    float bx = sqrt->getX();
    v_unit ex = v_unit(-0.5, v_unit::ex);
    float hex = ex.get(a);

    float x[10], y[10];
    float px[5], py[5];
    float t[4];
    px[0] = 0;      py[0] = 0.7*hex;
    px[1] = d;      py[1] = hex;
    px[2] = 3*d;    py[2] = gui->descent/2;
    px[3] = bx;     py[3] = ly;
    px[4] = gui->width;  py[4] = ly;
    t[0] = lineth/2;
    t[1] = 2*lineth;
    t[2] = t[3] = lineth;
    rootPoints(px, py, t, x, y);
    a->p->drawPolygon(10, x, y);
}
Exemplo n.º 2
0
// Print
void RiseBox::_print(std::ostream& os, 
		     const BoxRegion& region, 
		     const PrintGC& gc) const
{
    BoxPoint origin = region.origin();
    BoxPoint space  = region.space();
	
    if (gc.isFig()) {
	os << LINEHEAD1 ;
	os << linethickness() << LINEHEAD2 ;
	os << origin[X] << " " << origin[Y] + space[Y] << " " ;
	os << origin[X] + space[X] << " " << origin[Y] << " " ;
	os << "9999 9999\n" ;
    } else if (gc.isPostScript()) {
	os << origin[X] << " " << origin[Y] + space[Y] << " " ;
	os << origin[X] + space[X] << " " << origin[Y] << " " ;
	os << linethickness() << " line*\n";
    }
}
Exemplo n.º 3
0
void
MMLmsqrt::doLayout(MML::Attributes *a) const {
    MMLNode *sqrt = first;
    sqrt->layout(a);
    v_unit linethickness(0.05, l_unit::em);
    float lineth = linethickness.get(a);
    gui->ascent = sqrt->getAscent() + 4*lineth;
    gui->descent = sqrt->getDescent();
    float d = (gui->ascent + gui->descent)/12;
    gui->width = sqrt->getWidth()+5*d;
    sqrt->setX(5*d);
}