Remove .gitignore do nothing is ignored.
[synfig.git] / synfig-core / trunk / src / synfig / layer_duplicate.cpp
index 09c9e77..d002016 100644 (file)
@@ -70,7 +70,6 @@ Layer_Duplicate::Layer_Duplicate():
 Layer::Handle
 Layer_Duplicate::clone(const GUID& deriv_guid)const
 {
-       printf("cloning layer duplicate\n");
        Layer::Handle ret = (Layer::Handle)Layer_Composite::clone(deriv_guid);
 
        const DynamicParamList &dpl = dynamic_param_list();
@@ -78,7 +77,7 @@ Layer_Duplicate::clone(const GUID& deriv_guid)const
 
        // if we have a dynamic "index" parameter, make a new one in the clone
        // it's not good to have two references to the same index valuenode,
-       // or nested duplicatations cause an infinite loop
+       // or nested duplications cause an infinite loop
        if (iter != dpl.end())
                ret->connect_dynamic_param(iter->first,iter->second->clone(deriv_guid));
 
@@ -120,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