Logo Search packages:      
Sourcecode: inkscape version File versions

static double sp_curve_nonzero_distance_including_space ( SPCurve const *const   curve,
double  seg2len[] 
) [static]

Like sp_curve_distance_including_space, but ensures that the result >= 1e-18: uses 1 per segment if necessary.

Definition at line 1071 of file curve.cpp.

{
    double const real_dist(sp_curve_distance_including_space(curve, seg2len));
    if (real_dist >= 1e-18) {
        return real_dist;
    } else {
        unsigned const nSegs = SP_CURVE_LENGTH(curve) - 1;
        for (unsigned i = 0; i < nSegs; ++i) {
            seg2len[i] = 1.;
        }
        return (double) nSegs;
    }
}


Generated by  Doxygen 1.6.0   Back to index