From: dooglus Date: Sat, 29 Nov 2008 18:52:07 +0000 (+0000) Subject: Fix 2037732: The warp layer is using a rough way of calculating how much context... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=6efbfa12668470ae552d366baf539f5be142a002;p=synfig.git Fix 2037732: The warp layer is using a rough way of calculating how much context needs rendering. Any parts it misses are rendered pixel-by-pixel using get_color(). Layer_Duplicate::get_color() wasn't implemented, and so the duplicated layers weren't being rendered. Now it is. The warp layer still needs fixing. git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2306 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/synfig/layer_duplicate.cpp b/synfig-core/trunk/src/synfig/layer_duplicate.cpp index f9c77fa..d002016 100644 --- a/synfig-core/trunk/src/synfig/layer_duplicate.cpp +++ b/synfig-core/trunk/src/synfig/layer_duplicate.cpp @@ -119,7 +119,23 @@ Layer_Duplicate::set_time(Context context, Time time, const Point &pos)const Color Layer_Duplicate::get_color(Context context, const Point &pos)const { - return context.get_color(pos); + handle duplicate_param = get_duplicate_param(); + if (!duplicate_param) return context.get_color(pos); + + Color::BlendMethod blend_method(get_blend_method()); + float amount(get_amount()); + Color color; + + Mutex::Lock lock(mutex); + duplicate_param->reset_index(time_cur); + do + { + context.set_time(time_cur+1); + context.set_time(time_cur); + color = Color::blend(context.get_color(pos),color,amount,blend_method); + } while (duplicate_param->step(time_cur)); + + return color; } Layer::Vocab