Logo Search packages:      
Sourcecode: inkscape version File versions

int FloatLigne::AppendBord ( float  spos,
float  sval,
float  epos,
float  eval,
float  pente 
)

Add a coverage portion by appending boundaries at the end of the list.

This works because we know they are on the right.

Definition at line 256 of file float-line.cpp.

References bords, float_ligne_bord::other, float_ligne_bord::pente, float_ligne_bord::pos, s_first, s_last, float_ligne_bord::s_next, float_ligne_bord::s_prev, float_ligne_bord::start, and float_ligne_bord::val.

{
//  if ( showCopy ) printf("b= %f %f -> %f %f \n",spos,sval,epos,eval);
//    return AddBord(spos,sval,epos,eval,pente,s_last);
    if ( spos >= epos ) {
        return -1;
    }
    
#ifdef faster_flatten
    if ( std::abs(epos - spos) < 0.001 || std::abs(pente) > 1000 ) {
        return -1;
        epos = spos;
        pente = 0;
    }
#endif
    
    int n = bords.size();
    float_ligne_bord b;
    b.pos = spos;
    b.val = sval;
    b.start = true;
    b.other = n + 1;
    b.pente = pente;
    b.s_prev = s_last;
    b.s_next = n + 1;
    bords.push_back(b);
 
    if ( s_last >=  0 ) {
        bords[s_last].s_next = n;
    }
    
    if ( s_first < 0 ) {
        s_first = n;
    }

    n = bords.size();
    b.pos = epos;
    b.val = eval;
    b.start = false;
    b.other = n - 1;
    b.pente = pente;
    b.s_prev = n - 1;
    b.s_next = -1;
    bords.push_back(b);

    s_last = n;

    return n;
}


Generated by  Doxygen 1.6.0   Back to index