Logo Search packages:      
Sourcecode: inkscape version File versions

SPCurve* sp_curve_new_sized ( gint  length  ) 

Like sp_curve_new, but overriding the default initial capacity.

The returned curve's state is as if sp_curve_reset has just been called on it.

Parameters:
length Initial number of NArtBpath elements allocated for bpath (including NR_END element).

Definition at line 59 of file curve.cpp.

References SPCurve::bpath, SPCurve::closed, SPCurve::end, SPCurve::hascpt, SPCurve::length, SPCurve::moving, SPCurve::posSet, SPCurve::refcount, SPCurve::sbpath, and SPCurve::substart.

Referenced by sp_curve_new(), sp_curve_reverse(), and sp_curve_split().

{
    g_return_val_if_fail(length > 0, NULL);

    SPCurve *curve = g_new(SPCurve, 1);

    curve->refcount = 1;
    curve->bpath = nr_new(NArtBpath, length);
    curve->bpath->code = NR_END;
    curve->end = 0;
    curve->length = length;
    curve->substart = 0;
    curve->sbpath = false;
    curve->hascpt = false;
    curve->posSet = false;
    curve->moving = false;
    curve->closed = false;

    return curve;
}


Generated by  Doxygen 1.6.0   Back to index