Fix 2037732: The warp layer is using a rough way of calculating how much context...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sat, 29 Nov 2008 18:52:07 +0000 (18:52 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sat, 29 Nov 2008 18:52:07 +0000 (18:52 +0000)
git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2306 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/synfig/layer_duplicate.cpp

index f9c77fa..d002016 100644 (file)
@@ -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<ValueNode_Duplicate> 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