X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fgradient.cpp;h=d11cb1e7e99a901c299566dcb27368b59788bd6f;hb=64591d2bbceaf68a64008a0044e2fef3454e44ac;hp=6cdc8b013e8bdf156d44f0b2a3040cb207f8f9aa;hpb=dcaa03195d1779047d58d297dc5496a94e295e32;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/gradient.cpp b/synfig-core/trunk/src/synfig/gradient.cpp index 6cdc8b0..d11cb1e 100644 --- a/synfig-core/trunk/src/synfig/gradient.cpp +++ b/synfig-core/trunk/src/synfig/gradient.cpp @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -319,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; @@ -348,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; @@ -404,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.