From: dooglus Date: Thu, 22 Mar 2007 18:54:54 +0000 (+0000) Subject: Fix 1684240 (as it applies to conical gradients): Conical Gradient layers suffer... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=0220503540b8f3a6bd9274a8ca4f11f3e29364c4;p=synfig.git Fix 1684240 (as it applies to conical gradients): Conical Gradient layers suffer from the same problem as linear gradients. git-svn-id: http://svn.voria.com/code@368 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/modules/mod_gradient/conicalgradient.cpp b/synfig-core/trunk/src/modules/mod_gradient/conicalgradient.cpp index f2abd63..c4c2e62 100644 --- a/synfig-core/trunk/src/modules/mod_gradient/conicalgradient.cpp +++ b/synfig-core/trunk/src/modules/mod_gradient/conicalgradient.cpp @@ -168,14 +168,18 @@ ConicalGradient::color_func(const Point &pos, float supersample)const */ if(dist+supersample*0.5>1.0) { - Color pool(gradient(dist,supersample*0.5).premult_alpha()*(1.0-(dist-supersample*0.5))); - pool+=gradient((dist+supersample*0.5)-1.0,supersample*0.5).premult_alpha()*((dist+supersample*0.5)-1.0); + float left(supersample*0.5-(dist-1.0)); + float right(supersample*0.5+(dist-1.0)); + Color pool(gradient(1.0-(left*0.5),left).premult_alpha()*left/supersample); + pool+=gradient(right*0.5,right).premult_alpha()*right/supersample; return pool.demult_alpha(); } if(dist-supersample*0.5<0.0) { - Color pool(gradient(dist,supersample*0.5).premult_alpha()*(dist+supersample*0.5)); - pool+=gradient(1.0-(dist-supersample*0.5),supersample*0.5).premult_alpha()*(-(dist-supersample*0.5)); + float left(supersample*0.5-dist); + float right(supersample*0.5+dist); + Color pool(gradient(right*0.5,right).premult_alpha()*right/supersample); + pool+=gradient(1.0-left*0.5,left).premult_alpha()*left/supersample; return pool.demult_alpha(); }