X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fgradient.cpp;h=00f67b04562925c8f2daa0d59b357f05bd3e1a85;hb=1ba01d62f55407997aca33ed89d171ea7e5979d1;hp=ee4fa9e5832cd7306266dd00b75c170b0070481e;hpb=37600b4b217caa5e316984ec0b035c5e8f9698af;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/gradient.cpp b/synfig-core/trunk/src/synfig/gradient.cpp index ee4fa9e..00f67b0 100644 --- a/synfig-core/trunk/src/synfig/gradient.cpp +++ b/synfig-core/trunk/src/synfig/gradient.cpp @@ -203,7 +203,7 @@ synfig::Gradient::operator+=(const Gradient &rhs) // otherwise we sum the first in each, and the last in each else { - if (print) printf("[copying %d from left %d and %d from right %d at %.2f]\n", iter1-left_same+1, tpos1, iter2-right_same+1, tpos2, left.pos); + if (print) printf("[copying %ld from left %d and %ld from right %d at %.2f]\n", iter1-left_same+1, tpos1, iter2-right_same+1, tpos2, left.pos); // merge the front two cpoints if (print) printf(" copy front from left %d right %d\n", tpos1++, tpos2++); ret.push_back(CPoint(left.pos, left.color + right.color)); @@ -320,7 +320,7 @@ synfig::Gradient::operator()(const Real &x,float supersample)const const_iterator iter,next; /* - //optimizize... + //optimize... Real left = x-supersample/2, right = x+supersample/2; if(left < front().pos) left = front().pos; @@ -349,7 +349,7 @@ synfig::Gradient::operator()(const Real &x,float supersample)const //return Color::blend(iterr->color,iterl->color,lambda,Color::BLEND_STRAIGHT); }else { - //itegration madness + //integration madness const_iterator i = iterl, ie = iterr+1; Real wlast = left; @@ -405,7 +405,7 @@ synfig::Gradient::operator()(const Real &x,float supersample)const //! using a binary search. for(;iter=iter->pos && xpos && iter->pos!=next->pos) + if(next==end() || (x>=iter->pos && xpos && iter->pos!=next->pos)) { // If the supersample region falls square in between // two CPoints, then we don't have to do anything special.