memononen / nanosvg

Simple stupid SVG parser
zlib License
1.71k stars 363 forks source link

A misprint in nsvg__initPaint? #134

Open SergeySlice opened 6 years ago

SergeySlice commented 6 years ago
    if (grad->nstops == 0) {
        for (i = 0; i < 256; i++)
            cache->colors[i] = 0;
    } if (grad->nstops == 1) {
        for (i = 0; i < 256; i++)
            cache->colors[i] = nsvg__applyOpacity(grad->stops[i].color, opacity);
    } else {
        unsigned int ca, cb = 0;

there must be

 } else if (grad->nstops == 1) {

to avoid executing "} else {" if nstops == 0.