Logo Search packages:      
Sourcecode: inkscape version File versions

template<class M>
static void tmpl_curve_transform ( SPCurve *const   curve,
M const &  m 
) [inline, static]

Transform all paths in curve, template helper.

Definition at line 270 of file curve.cpp.

References SPCurve::_bpath, NArtBpath::c(), NArtBpath::code, SPCurve::end, NR_CURVETO, NR_LINETO, NR_MOVETO, NR_MOVETO_OPEN, and NArtBpath::setC().

{
    g_return_if_fail(curve != NULL);

    for (gint i = 0; i < curve->end; i++) {
        NArtBpath *p = curve->_bpath + i;
        switch (p->code) {
            case NR_MOVETO:
            case NR_MOVETO_OPEN:
            case NR_LINETO: {
                p->setC(3, p->c(3) * m);
                break;
            }
            case NR_CURVETO:
                for (unsigned i = 1; i <= 3; ++i) {
                    p->setC(i, p->c(i) * m);
                }
                break;
            default:
                g_warning("Illegal pathcode %d", p->code);
                break;
        }
    }
}


Generated by  Doxygen 1.6.0   Back to index