From 6e91754512f0ae9303be32b3bca06904e3866e4f Mon Sep 17 00:00:00 2001 From: dooglus Date: Sat, 22 Nov 2008 15:39:00 +0000 Subject: [PATCH] Shortcut color blending in get_color() when blend method is 'straight' and amount is 1.0. git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2248 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/modules/example/metaballs.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/synfig-core/trunk/src/modules/example/metaballs.cpp b/synfig-core/trunk/src/modules/example/metaballs.cpp index a582dc1..b365ea5 100644 --- a/synfig-core/trunk/src/modules/example/metaballs.cpp +++ b/synfig-core/trunk/src/modules/example/metaballs.cpp @@ -178,7 +178,12 @@ Color Metaballs::get_color(Context context, const Point &pos)const { if (totaldensity(pos) >= threshold) - return Color::blend(color,context.get_color(pos),get_amount(),get_blend_method()); + { + if(get_amount()==1.0 && get_blend_method()==Color::BLEND_STRAIGHT) + return color; + else + return Color::blend(color,context.get_color(pos),get_amount(),get_blend_method()); + } else return context.get_color(pos); } -- 2.7.4