Add on the time_offset parameter when looking for waypoints in sub-canvases of PasteC...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 24 Oct 2007 00:32:07 +0000 (00:32 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 24 Oct 2007 00:32:07 +0000 (00:32 +0000)
git-svn-id: http://svn.voria.com/code@957 1f10aa63-cdf2-0310-b900-c93c546f37ac

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

index b2a0424..abbfc76 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "timepointcollect.h"
 #include "valuenode_animated.h"
 
 #include "timepointcollect.h"
 #include "valuenode_animated.h"
+#include "layer_pastecanvas.h"
 #include "layer.h"
 #include "canvas.h"
 #include "value.h"
 #include "layer.h"
 #include "canvas.h"
 #include "value.h"
@@ -90,7 +91,13 @@ synfig::waypoint_collect(set<Waypoint, std::less<UniqueID> >& waypoint_set,const
                ValueBase canvas_value(layer->get_param("canvas"));
                if(canvas_value.get_type()==ValueBase::TYPE_CANVAS)
                {
                ValueBase canvas_value(layer->get_param("canvas"));
                if(canvas_value.get_type()==ValueBase::TYPE_CANVAS)
                {
-                       ret+=waypoint_collect(waypoint_set,time,Canvas::Handle(canvas_value.get(Canvas::Handle())));
+                       etl::handle<Layer_PasteCanvas> p = etl::handle<Layer_PasteCanvas>::cast_dynamic(layer);
+                       if (p)
+                               ret+=waypoint_collect(waypoint_set, time + p->get_time_offset(),
+                                                                         Canvas::Handle(canvas_value.get(Canvas::Handle())));
+                       else
+                               ret+=waypoint_collect(waypoint_set, time,
+                                                                         Canvas::Handle(canvas_value.get(Canvas::Handle())));
                }
                return ret;
        }
                }
                return ret;
        }